
Topics
Replies
FMogyi
26 Jan 2017, 15:02
Hi,
If you use more cBots simultaneously you should use Label parameter (means cBot ID) when managing your positions and orders.
Here is an example for closing:
//
var positions = Positions.FindAll(Label, Symbol); // cBot gets own positions only.
foreach (var position in positions)
{
TradeResult result = ClosePosition(position);
if (!result.IsSuccessful)
{
Print("*** ClosePos Err: {0} {1} {2} {3}", position.Id, position.Label, position.TradeType, result.Error);
error++;
}
else if (debug)
Print("--> {0} ClosePosition Ok.", position.Id);
}
}
Best Regards
@FMogyi
FMogyi
19 Jan 2017, 13:52
Hi, thanks, your answer but I think your advice is wrong. bAuth is initialised bool variables at OnStart and bWeekend gets value at every OnBar function.
The cBot runs for an hours well for a while. The OnTick function was called well more hundreds or more thousands times before the problem occurs.
@FMogyi
FMogyi
02 Mar 2016, 20:17
( Updated at: 04 Mar 2016, 12:06 )
This post was removed by moderator because it duplicates another post. /forum/calgo-support/8466?page=1#2
@FMogyi
FMogyi
27 Jan 2017, 14:29
Thanks
@FMogyi