Flash proof stop limit orders | Traders Hideout


futures.io - futures trading strategies, market news, trading charts and platforms


Traders Hideout


Discuss day trading practices and futures trading strategies on this forum for all markets. This forum is also for discussing and reviews for brokers, data feeds, and commercial or third party add-ons




 

Flash proof stop limit orders

  #5 (permalink)

charlotte nc
 
Trading Experience: Master
Platform: ninjatrader
Broker/Data: NinjaTrader
Favorite Futures: Emini (ES, YM, NQ, ect.)
 
Posts: 379 since Jan 2015
Thanks: 69 given, 919 received

HI Virtuose1,

Since some of your use case relates to speed of execution and you are on NT, I think I can help you out with a couple more thing to consider.... (You may already know some of this but I am just going to punt it out there in case you find it useful.) I would have killed to have known some of this early on when I was pulling out my hair...

One thing you may want to research with the approach you mentioned is: What is the performance difference executing change orders vs. submitting new orders as the market moves. If you are using NinjaTraders managed approach, you may not see this nuance in the code, and may not realize the difference... but any sort of change order will typically take longer to process vs submitting a new order. How long may depend on your broker, data feed, proximity to the exchange and how you code.

In my case a change order can take 50 milliseconds to up to 200 milliseconds but a new order typically executes for me in < 10 milliseconds. I am using CGQ / NT Brokerage and co-locating in Chicago near the exchange on a VPS as a reference point.

Once I missed a few fills chasing the price with change orders, I started laddering different passive limit exits as new orders at different tick intervals. My execution speed has improved by a significant magnitude because of this.

But there is a big time downside with this... I am using the unmanaged approach and coding this type of complexity has been fairly time consuming to test and debug because you are ultimately left with several unfilled orphan orders and you will have to manage the cancels with custom logic. But if you are up for the challenge and don't mind the headache of going unmanaged and coding some complex order routing, your reward can be 100 to 200 millseconds better execution on every exit.


And one final thing, since you are a fellow NT coder out there fighting the good fight.... The most granular event hander you can use with NT is of course OnMarketDepth so one would think that it would be best to use this capture price level changes for example: marketDepthUpdate.Bid. But in actuality the OnBarUpdate events front run the OnMarketData and OnMarketDepth event by sometimes as much as 1 to 2 seconds. Typically this is around 100 millseconds, though sometimes they can be in sync. I have also learned that regardless of what event handler you use to call the OnBarUpdate event. GetCurrentBid() for example, the frequency of the update will always be based on your selected time series. So if you want to capture the price level changes as fast as NinjaTrader is capable of doing it. You have to go with the OnBarUpdate methods of GetCurrentBid() and GetCurrentAsk() and unfortunately you will have to run the time series of Tick and the value of 1 (This is as granular as it gets with NT). The OnBarUpdate method is far less granular that the level 2 method and typically only take an update 1 time for every 10,20, 50 updates you get with level 2 data, but when a price level ever changes this will always update first.

Also stay away from OnPositionUpdate events and always go with OnOrderUpdate because this will be significantly faster to capture your order state changes.


If you add all these little things up you are likely going to gain 1 full second and that makes all the difference in the world using limit orders chasing exits.


Best of luck!

Ian



Virtuose1 View Post
Thanks a lot for taking the time to provide your answer Ian, truly appreciated.

The stop-limit orders that I use are custom developed in NT. The sell order is triggered once the max daily loss % is reached and the price of the limit order is adjusted real-time (i.e.: will move with the market to increase chances of being filled). To avoid the scenario where the market would fall very quickly and my sell limit order wouldn't get filled, I thinking of something like:
- Price drop within "standard threshold" (whether ATR or % based): use my regular stop loss limit order
- Price drop is "acute" : set my limit price quite a few ticks below the bid to increase chances of being filled
- Price drop is "insane" (e.g.: flashcrash with price dropping over 50%): Do nothing and wait to be back in "acute" level

Other traders thoughts are welcomed.

Thanks again


In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.

Last edited by iantg; April 18th, 2018 at 08:39 PM.
Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to iantg for this post: