I have developed a strategy wich places an entry order and after it is filled I place the embracing Stop and Target orders via OnExecution.
By the strategy it is possible that the entry is filled or not while a reverse trigger is rising. How should I develop the reverse algo that the order cancelation and new order placement will be working perfectly?
My current solution is that:
1. Place an entry order as liveUntilCancel....
2. Wait for excecution
3. OnExecution place stop/target order....
4. Wait for stop or target
5 The reverse trigger raises (old entry is filled)
--> cancel stop/traget order
--> Exit...() closing the current entryOrder
--> Place a new entry order
--> Wait for a fill...
Or is there a better way? Sometimes I get a wrong quantity, espacially if
the close an the reverse trigger will be raising at the same time.
NOTE: It is not a common revers system because I'M not always in the market, only if the limit orders were touched, the I'm reacting.
Thanks for your help.
cicondo
PS: After reading forum comments I'm really surprised, that there is no template that shows how the ordering works for reversals. Some guy here are certainly very expirienced programmers, which doens't help in understanding the order flow in NT. And obviously there is a lack of documentation.
Comment