How to run 2 instances of one robot for the same currency pair independently.
How to run 2 instances of one robot for the same currency pair independently.
05 Jan 2019, 12:57
I have tuned my robot and I found that 2 different sets of parameters works well. Now I would like to run robot with 2 instances for the same currency pair but with different input parameters. How to run them independently ?
I am referring to following line which I have in the code:
var longPosition = Positions.Find(label, Symbol, TradeType.Buy);
'label' is the same for both instances so for example first instance may find open positions of second instance.
I tried following but it doesn't work:
I created robot parameter to assign custom name:
[Parameter("Custom name", DefaultValue = "std")]
public string CustomName { get; set; }
......
public string label = "test-01DE" + CustomName;
but I receive error:
"Error CS0236: A field initializer cannot reference the non-static field, method, or property 'cAlgo.Robots.RobotDAX.CustomName.get'"
Thanks in advance for any help
SYlwester
Replies
... Deleted by UFO ...
DelFonseca
06 Jan 2019, 02:58
Hey,
You need add your parameter "CustomName" to the trading syntax, not to the string label declaration.
Here you only declarate a name to your label:
Here you add the parameter "CustomName":
After that just add 2 cbots with diff "CustomName", you can add to the same chart.
I hope i can have helped you and im sory for my English.
@DelFonseca