Port St. Lucie, FL.
Posts: 25 since May 2016
Thanks Given: 17
Thanks Received: 9
|
I'm building a TradeStation strategy for automated execution (robot trader).
I want the ability to enter and exit mid-bar, or in a subsequent bar.
i.e. If conditions are met at 7 minutes into a fifteen minute bar, the entry or exit will be executed immediately without waiting for open of next bar. On the other hand; if conditions are not met for several bars, the strategy will execute mid-bar (of a subsequent bar) when conditions are met.
I am using "[IntrabarOrderGeneration = TRUE]" and coding as follows:
//Long Entry
If MP=0 and H=H[1] then buy this bar;
MP = 1;
//Long Exit
If MP=1 and H=H[1]-.25 then sell this bar;
MP = 0;
The exit is working, and will get me out instantly, but the entry is not. It delays until the open of the next bar.
How should I code the entry statement to execute instantly when conditions are met (in current or future bars)?
Thanks
|