exitTrade causes for(current_trades) not being cycled

Posted By: SnoopySniff

exitTrade causes for(current_trades) not being cycled - 12/15/18 21:50

I am cycling through open trades with for(current_trades) and do some stuff in it.

Then later I am closing specific trades with exitTrade(ThisTrade) in an other for(last_trades) cycle.

After that exitTrade procedure the for(current_trades) is not entered anymore, even there is at least one trade open.

I can't find a solution. Could it be a bug? Any help is appreciated.

PS: Same problem with for(open_trades)...
Posted By: AndrewAMD

Re: exitTrade causes for(current_trades) not being cycled - 12/15/18 21:59

Post script.
Posted By: SnoopySniff

Re: exitTrade causes for(current_trades) not being cycled - 12/15/18 23:27

I just found the problem. I was using a for cycle in a for cycle which is not allowed. Thank you!
Posted By: sarmasboy

Re: exitTrade causes for(current_trades) not being cycled - 05/06/19 19:45

Hey all, I'm having the same issue frown I checked and mine doesn't have any additional for loops. Here's a snippet of my code:

Code:
if(...) {
  ...
} else if(...) {
  for(open_trades) {
    printf("Entry Limit 1: %.5f", (var)TradeEntryLimit);
    if(TradeIsPending) exitTrade(ThisTrade);
  }
}



It stops after finding the first pending order. I have the printf() to figure out which one is not closing. Any other ideas why it's not working?

Laurynas
Posted By: jcl

Re: exitTrade causes for(current_trades) not being cycled - 05/08/19 09:00

The code looks ok, so it should not stop, unless the closed trade was the only one. If you can't find the reason, you can contact Support with the script. They'll look into it. Maybe it is something that depends on other settings in the script.
© 2024 lite-C Forums