Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (MadJack, AndrewAMD, Quad), 540 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
exitTrade causes for(current_trades) not being cycled #475497
12/15/18 21:50
12/15/18 21:50
Joined: Oct 2018
Posts: 79
S
SnoopySniff Offline OP
Junior Member
SnoopySniff  Offline OP
Junior Member
S

Joined: Oct 2018
Posts: 79
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)...

Last edited by SnoopySniff; 12/15/18 22:34.
Re: exitTrade causes for(current_trades) not being cycled [Re: SnoopySniff] #475498
12/15/18 21:59
12/15/18 21:59
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Post script.

Re: exitTrade causes for(current_trades) not being cycled [Re: AndrewAMD] #475501
12/15/18 23:27
12/15/18 23:27
Joined: Oct 2018
Posts: 79
S
SnoopySniff Offline OP
Junior Member
SnoopySniff  Offline OP
Junior Member
S

Joined: Oct 2018
Posts: 79
I just found the problem. I was using a for cycle in a for cycle which is not allowed. Thank you!

Re: exitTrade causes for(current_trades) not being cycled [Re: SnoopySniff] #477050
05/06/19 19:45
05/06/19 19:45
Joined: May 2019
Posts: 11
S
sarmasboy Offline
Newbie
sarmasboy  Offline
Newbie
S

Joined: May 2019
Posts: 11
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

Last edited by sarmasboy; 05/06/19 19:46.
Re: exitTrade causes for(current_trades) not being cycled [Re: sarmasboy] #477053
05/08/19 09:00
05/08/19 09:00
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
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.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1