Gamestudio Links
Zorro Links
Newest Posts
MRC.c and WFO
by 11honza11. 11/18/25 15:22
webGL
by Ice2642. 11/17/25 21:27
Camera always moves upwards?
by NeoDumont. 11/17/25 09:56
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, Quad), 32,974 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
SkinnyApe, tritom, sheliepaley, Blueguy, blobplayintennis
19179 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