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
How do you attach a trade management function to pending orders #427068
08/01/13 16:20
08/01/13 16:20
Joined: May 2013
Posts: 245
S
swingtraderkk Offline OP
Member
swingtraderkk  Offline OP
Member
S

Joined: May 2013
Posts: 245
Hi all,

Can someone explain the syntax for attaching a tick by tick trade management function to a pending trade. e.g. for cancelling other trades as soon as one is hit, or for pyramiding in once a trade has moved in your direction?

Or is there another method to respond to events mid bar, events such as when pending trades are opened or when open trades are closed?

Re: How do you attach a trade management function to pending orders [Re: swingtraderkk] #427199
08/05/13 08:36
08/05/13 08:36
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
For cancelling other trades, use a global variable "CancelOtherTrades" that is set and evaluated by the TMF.

Code:
int MyTMF()
{
  if(TradeIsPending and CancelOtherTrades == 1)
    return 1;
  if(TradeIsOpen) {
    CancelOtherTrades = 1;
    ThisTrade->manage = 0; // terminate the TMF
  }
  return 0;
}



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