Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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
Can you help answer these questions from other members on NexusFi?
welcome to NexusFi. When using intrabar order generation in Tradestation "Next bar" orders will be executed at the next tick that is processed, while "this bar" orders will only be processed at the end of the bar. That's why you are getting your orders filled at the open only.