Flash proof stop limit orders - Traders Hideout | futures io social day trading
futures io futures trading


Flash proof stop limit orders
Updated: Views / Replies:669 / 7
Created: by Virtuose1 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Flash proof stop limit orders

  #1 (permalink)
Montreal, Qc, Canada
 
Trading Experience: Advanced
Platform: NinjaTrader 7
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: ETF
 
Virtuose1's Avatar
 
Posts: 52 since Jun 2011
Thanks: 137 given, 34 received

Flash proof stop limit orders

The following article does a great job at setting the context of my question: https://sixfigureinvesting.com/2012/10/needed-a-way-to-flash-proof-your-stop-limit-orders/

I'd be interested to get other traders insights on how best handle stop limit orders of automated algos during flash crash events.


Thanks


Last edited by Virtuose1; April 17th, 2018 at 07:06 PM.
Reply With Quote
The following user says Thank You to Virtuose1 for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (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,

I will just start by saying that I use these a lot and with the high volatility we have seen lately, there have been lots of days that behaved like flash crashes almost. There are definitely pros and cons to using these though.

Pros: These are obvious. You can protect yourself from a large swing in the price against you. You can also capture the spread and use these to scratch trades at a break even, or only lose 1 to 2 ticks if you time your exits with your algo in such a way that you do not cross the spread.

Cons: Depending on when and where you place these, you can have scenarios where you miss your fill and the market moves against your position further and you are left naked. For example if you are trying use a passive exit on the Ask to get out of a long position, this can help you recover 1 tick, but it can also create a risk that you miss your fill and market continues down depending on how far out you place your order. If you are submitting this on the current price level or 1 price level out and the price level quickly moves, then you are exposed to this risk. If the current price level is at bid = 2000 and ask = 2000.25 and you place your stop limit at Sell Ask @ 2000.25, then the only way you are guaranteed a fill is if the Ask queue clears and everyone @ 2000.25 is filled and the price level moves up to Bid = 2000.25 and Ask = 2000.5. But conversely if the price level moves down to Bid = 1999.75 an Ask = 2000 then this implied that the bid queue was cleared and you may not have been far enough up in the ask queue at 2000.25 to get filled. So the market can continue downward without you leaving you naked and afraid (Metaphorically of course).

I typically only use stop-limits 3-5 ticks out from my entry to avoid the very situation i described in my "cons" section. But as long as my execution timing relative to the market speed is fast enough I avoid the scenario I described. To catch a scratch exit or maintain the spread on any other exit, I just use regular limit orders timed perfectly for the current price level to know which side to submit to (The bid or Ask). I usually give my self 3 5 levels to chase that sweet passive exit before I give up and just use the stop limit as my safety exit. Obvious this all has to be done using level 2 event handlers (more granular that a 1 tick chart for example) to optimize what you are reacting to. And unless you are collocating, and writing highly optimized speed efficient code this will not work for you either. For example with Ninja trader if you wait until OnPositionUpdate occurs to react to something you will be too late most of the time.

I also have another layer of code after the stop limit if I hit the "con" scenario I described to cross the spread and get out with a market order. This is only triggered as a last resort though.

I think the use case I have described is fairly common for any serious robust algo trader.

Best of luck out there!

Ian

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.
Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to iantg for this post:
 
  #4 (permalink)
Montreal, Qc, Canada
 
Trading Experience: Advanced
Platform: NinjaTrader 7
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: ETF
 
Virtuose1's Avatar
 
Posts: 52 since Jun 2011
Thanks: 137 given, 34 received


iantg View Post
Hi Virtuose1,

I will just start by saying that I use these a lot and with the high volatility we have seen lately, there have been lots of days that behaved like flash crashes almost. There are definitely pros and cons to using these though.

Pros: These are obvious. You can protect yourself from a large swing in the price against you. You can also capture the spread and use these to scratch trades at a break even, or only lose 1 to 2 ticks if you time your exits with your algo in such a way that you do not cross the spread.

Cons: Depending on when and where you place these, you can have scenarios where you miss your fill and the market moves against your position further and you are left naked. For example if you are trying use a passive exit on the Ask to get out of a long position, this can help you recover 1 tick, but it can also create a risk that you miss your fill and market continues down depending on how far out you place your order. If you are submitting this on the current price level or 1 price level out and the price level quickly moves, then you are exposed to this risk. If the current price level is at bid = 2000 and ask = 2000.25 and you place your stop limit at Sell Ask @ 2000.25, then the only way you are guaranteed a fill is if the Ask queue clears and everyone @ 2000.25 is filled and the price level moves up to Bid = 2000.25 and Ask = 2000.5. But conversely if the price level moves down to Bid = 1999.75 an Ask = 2000 then this implied that the bid queue was cleared and you may not have been far enough up in the ask queue at 2000.25 to get filled. So the market can continue downward without you leaving you naked and afraid (Metaphorically of course).

I typically only use stop-limits 3-5 ticks out from my entry to avoid the very situation i described in my "cons" section. But as long as my execution timing relative to the market speed is fast enough I avoid the scenario I described. To catch a scratch exit or maintain the spread on any other exit, I just use regular limit orders timed perfectly for the current price level to know which side to submit to (The bid or Ask). I usually give my self 3 5 levels to chase that sweet passive exit before I give up and just use the stop limit as my safety exit. Obvious this all has to be done using level 2 event handlers (more granular that a 1 tick chart for example) to optimize what you are reacting to. And unless you are collocating, and writing highly optimized speed efficient code this will not work for you either. For example with Ninja trader if you wait until OnPositionUpdate occurs to react to something you will be too late most of the time.

I also have another layer of code after the stop limit if I hit the "con" scenario I described to cross the spread and get out with a market order. This is only triggered as a last resort though.

I think the use case I have described is fairly common for any serious robust algo trader.

Best of luck out there!

Ian

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

Reply With Quote
 
  #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

Answer
This post has been selected as an answer to the original posters question Answer

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:
 
  #6 (permalink)
Montreal, Qc, Canada
 
Trading Experience: Advanced
Platform: NinjaTrader 7
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: ETF
 
Virtuose1's Avatar
 
Posts: 52 since Jun 2011
Thanks: 137 given, 34 received


iantg View Post
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

These are awesome insights Ian, many thanks.

Reply With Quote
 
  #7 (permalink)
Point Roberts, WA, USA
 
Trading Experience: Advanced
Platform: IB and free NT
Broker/Data: IB
Favorite Futures: ES
 
aquarian1's Avatar
 
Posts: 3,674 since Dec 2010
Thanks: 1,442 given, 2,286 received

One thing to be aware of is non-reviewable ranges.
For ES it is 6 pts I believe.
If your order gets to the exchange and the price has fallen more than that it is rejected as too far off the market.
This happens to market stop orders in a very fast fall.

For this I would recommend staggered OCA stop-limit orders

Keep your mind in the future, in the now.
Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to aquarian1 for this post:
 
  #8 (permalink)
North Carolina
 
Trading Experience: Beginner
Platform: NinjaTrader, Tradestation
Favorite Futures: es
 
Posts: 644 since Nov 2011

You might look at options trades and/or using position size to manage risk instead. For active futures trader, checking calendar first and not trading outside regular market hours will reduce much of the risk. Be aware of general times reports are released helps also. For example, with ES, I think 8:30 is common release time for certain reports because it is pre-market and a report then that is a very risky period to trade.

Reply With Quote

Reply



futures io > > > Flash proof stop limit orders




Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$1,000 in Amazon Gift Cards being given away right now from GFF Brokers

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

August
 

Webinar: AutoTrading World Cup Advisor w/GFF Brokers

Aug 22
 

Webinar: Suri Duddella (TBA)

Elite only
 

Webinar: Richard Bailey (TBA)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
OCO orders, set Limit and Stop Limit automatically rice0721 ThinkOrSwim 5 January 3rd, 2019 03:28 PM
Limit vs stop vs stop-limit orders ghl123 Traders Hideout 10 April 29th, 2015 03:01 AM
Stop Limit Orders - please clarify nourozi Traders Hideout 6 July 15th, 2013 08:16 AM
Immediate Stop and Limit orders interfool EasyLanguage Programming 4 November 15th, 2012 07:08 PM
Stop limit orders in MC strat aczk EasyLanguage Programming 13 June 19th, 2012 06:57 AM


All times are GMT -4. The time now is 10:23 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts