Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to close (cancel) all pending trades? #447969
01/15/15 12:25
01/15/15 12:25
Joined: Apr 2014
Posts: 45
Germany
webradio Offline OP
Newbie
webradio  Offline OP
Newbie

Joined: Apr 2014
Posts: 45
Germany
how do I close all pending trades? (must work in Train/Test as well)
Code:
for (open_trades)
  if (TradeIsPending) 
    exitTrade(ThisTrade);

?

Last edited by webradio; 01/15/15 12:50.
Re: how to close (cancel) all pending trades? [Re: webradio] #447972
01/15/15 12:57
01/15/15 12:57
Joined: Jul 2000
Posts: 28,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,029
Frankfurt
Yes, that should work.

Re: how to close (cancel) all pending trades? [Re: jcl] #447980
01/15/15 15:57
01/15/15 15:57
Joined: Apr 2014
Posts: 45
Germany
webradio Offline OP
Newbie
webradio  Offline OP
Newbie

Joined: Apr 2014
Posts: 45
Germany
Having all pending trades closed as scripted above, shouldn't NumPendingTrades return zero?
Code:
Hedge = 4; 
printf("\nBefore deleting, NumPendingTotal==%d",NumPendingTotal);
for (open_trades) {
  if (TradeIsPending) {
    exitTrade(ThisTrade);
  }
}
printf("\nAfter deleting, NumPendingTotal==%d",NumPendingTotal);


Output:
Code:
Before deleting, NumPendingTotal==4
After deleting, NumPendingTotal==4

(Number four just like hedge mode ist only a coincidence)

Re: how to close (cancel) all pending trades? [Re: webradio] #448233
01/23/15 21:59
01/23/15 21:59
Joined: Apr 2014
Posts: 45
Germany
webradio Offline OP
Newbie
webradio  Offline OP
Newbie

Joined: Apr 2014
Posts: 45
Germany
Anybody? Shouldn't NumPendingTotal decrease immediately after closing a pending trade using exitTrade() ?

Re: how to close (cancel) all pending trades? [Re: webradio] #448268
01/26/15 17:49
01/26/15 17:49
Joined: Jul 2000
Posts: 28,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,029
Frankfurt
I don't think so. Global variables are updated before the run() function, not within a TMF.


Moderated by  Petra 

Gamestudio download | 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