Gamestudio Links
Zorro Links
Newest Posts
Gracefully closing a panel
by Zheka. 07/17/19 15:02
MaxDD in %
by Zheka. 07/17/19 14:51
New Zorro version 2.15
by jcl. 07/17/19 12:21
Issues with converting .csv to .t6
by jcl. 07/16/19 14:46
IG plugin initial release
by YG8. 07/16/19 10:02
First Steps for backtesting with ASCII data
by Charttrader. 07/16/19 08:50
Beginners Workshop
by jcl. 07/15/19 06:29
Dukascopy plugin (yet another version)
by dh85. 07/15/19 05:03
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
12 registered members (jyd, kvm, Peeyotch, Grat, AndrewAMD, FLD, TradingMax, Quad, Matt_Aufderheide, 1 invisible), 705 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Charttrader, bjomu, catharticlapse, carmyss121, Evox
18255 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: 50
S
SnoopySniff Offline OP
Junior Member
SnoopySniff  Offline OP
Junior Member
S

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

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: 683
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 683
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: 50
S
SnoopySniff Offline OP
Junior Member
SnoopySniff  Offline OP
Junior Member
S

Joined: Oct 2018
Posts: 50
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: 2
S
sarmasboy Offline
Guest
sarmasboy  Offline
Guest
S

Joined: May 2019
Posts: 2
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: 26,942
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 26,942
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.


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