Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,232 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Closing a single trade #429880
09/19/13 19:51
09/19/13 19:51
Joined: Nov 2012
Posts: 126
B
blaub4r Offline OP
Member
blaub4r  Offline OP
Member
B

Joined: Nov 2012
Posts: 126
All I want to do is to close a single trade out of all the open ones.

I used this code:

for (open_trades)
{
exitTrade(ThisTrade);
// printf("trade geschlossen");
break;
}

However, this does not always close a trade (The message is still printed). Why is that?

Re: Closing a single trade [Re: blaub4r] #429882
09/19/13 20:48
09/19/13 20:48
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
Wouldn't it be because the TMF routine is run at every tick? Thus each time it would close the next trade?

Re: Closing a single trade [Re: dusktrader] #429885
09/19/13 21:04
09/19/13 21:04
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
This isn't in a TMF, is it? for(open_trades) is a no-no in a TMF...

Without seeing the rest of the script, could it be what's bit me in the past? open_trades is a bit mis-named. It includes pending trades also. To be sure the 1st (or any) trade is open you must add if(TradeIsOpen)...

Re: Closing a single trade [Re: DdlV] #429896
09/20/13 09:28
09/20/13 09:28
Joined: Nov 2012
Posts: 126
B
blaub4r Offline OP
Member
blaub4r  Offline OP
Member
B

Joined: Nov 2012
Posts: 126
Originally Posted By: DdlV
This isn't in a TMF, is it? for(open_trades) is a no-no in a TMF...

Without seeing the rest of the script, could it be what's bit me in the past? open_trades is a bit mis-named. It includes pending trades also. To be sure the 1st (or any) trade is open you must add if(TradeIsOpen)...


Thanks, this fixes the issue laugh


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1