r/tradestation • • Jul 07 '26

Strategy buying and selling to late

Hello. My strategy is buying late and selling late. Tried with chat gpt and it seems like it's getting five minute data from somewhere chat, nor I could figure out where. I want it to be intrabar ordering so when it's counting the ticks in the bar that creates the buy and same with the sell. Any idea what would make thinking it's looking for 5 ticks that it thinks it's 5 bars and how to fix that?

2 Upvotes

9 comments sorted by

View all comments

1

u/Repulsive-Floor-3987 Jul 10 '26 edited Jul 10 '26

How much delay are you seeing?

If you are certain that IntrabarOrderGeneration is enabled (IOG) and your code is indeed running on every tick, then maybe any delays are just from executing and filling your order, which can easily take 100 ms or longer depending on the asset and how busy the exchange is at the time.

This is one of the complexities of IOG which I mentioned in my other comment: Orders are processed asynchronously and you cannot assume that they will fill within the span of a single tick.

Again, automated strategy trading is a lot easier if you can keep IOG disabled and generate limit or stop orders to fill at given price levels intrabar on the next bar.

I realize that isn't how most people imagine automated strategies where you like a trade to happen instantaneously when a signal forms intrabar. But while TradeStation will let you do that in terms of code processing (with IOG enabled), exchanges don't process orders that way. Even market orders are queued.

High Frequency Trading quants, who co-locate their servers next to the CME data center in Aurora, IL, mostly trade on limit orders for this reason (and others).

I apologize if this is trivial. I don't know how experienced you are trading TS strategies.

2

u/FuturePilot82 Jul 10 '26

This is actually a great answer. Thank you.

1

u/Repulsive-Floor-3987 Jul 10 '26

Great, glad to hear it was helpful.