Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (AndrewAMD, fogman, Grant, juanex), 972 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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