Exiting on stop VS limit
Forums › ProRealTime English forum › ProOrder support › Exiting on stop VS limit
- This topic has 9 replies, 3 voices, and was last updated 5 years ago by
Vonasi.
-
-
02/25/2020 at 12:55 PM #120427
Hello everyone – I would like your help if you would be so kind…
I’d like to understand why there is a difference between the time of exit using “stop” as opposed to “limit”. I obviously understand the fundamental differences between stops and limits in real life, but I can’t explain why the differences are sometimes so pronounced in Pro Order.
As you can see from the screengrabs, if I use “sell at close STOP” then the trade exits the bar after the graphed entry condition, which is what I would expect. But if I were to change that code to “sell at close LIMIT”, the trade exits three bars later. Throughout most of my dataset, using Limit exits the trade in the same bar and it seems to improve my results by about one point per trade, but in this case it is quite a large difference that goes against me.
Why should be this be?
Stop code123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132DEFPARAM CumulateOrders = Falselongentry1= close crosses over SuperTrend[1.5,34]shortentry1= close crosses under SuperTrend[1.5,34]longexit1= close < SuperTrend[1.5,34]shortexit1= close > SuperTrend[1.5,34]fri1start=005200fri1end=012200fri2start=012400fri2end=023400fri3start=044200fri3end=055200fri4start=074600fri4end=085600fri5start=125200fri5end=140200fri6start=143600fri6end=154600fri7start=163200fri7end=174200fri8start=0fri8end=0if intradaybarindex=0 thenentryflag=0endifif time =fri1start and opendayofweek=5 thenentryflag=1endifif time =fri1end and opendayofweek=5 thenentryflag=0endifif time =fri2start and opendayofweek=5 thenentryflag=1endifif time =fri2end and opendayofweek=5 thenentryflag=0endifif time =fri3start and opendayofweek=5 thenentryflag=1endifif time =fri3end and opendayofweek=5 thenentryflag=0endifif time =fri4start and opendayofweek=5 thenentryflag=1endifif time =fri4end and opendayofweek=5 thenentryflag=0endifif time =fri5start and opendayofweek=5 thenentryflag=1endifif time =fri5end and opendayofweek=5 thenentryflag=0endifif time =fri6start and opendayofweek=5 thenentryflag=1endifif time =fri6end and opendayofweek=5 thenentryflag=0endifif time =fri7start and opendayofweek=5 thenentryflag=1endifif time =fri7end and opendayofweek=5 thenentryflag=0endifif time =fri8start and opendayofweek=5 thenentryflag=1endifif time =fri8end and opendayofweek=5 thenentryflag=0endifif not onmarket and entryflag=1 and lowest[4] <= lowest[30] and longentry1 thenBUY 1 PERPOINT AT MARKETentryflag=0endifif not onmarket and entryflag=1 and highest[4] >= highest[30] and shortentry1 thenSellshort 1 perpoint at marketentryflag=0endifif longonmarket and longexit1 thensell at close stopendifif shortonmarket and shortexit1 thenexitshort at close stopendifgraph longexit102/25/2020 at 4:54 PM #120477A pending order is an order that was not yet executed, thus not yet becoming a trade. It can, for example, be an order that states that you do not want to buy before the price of a financial instrument reaches a certain point.
If you want to close a long order with a sell limit, the price must touch the desired level from below and this is what it seemed to happen on your second picture.
1 user thanked author for this post.
02/25/2020 at 5:01 PM #120480Thanks for the response. That all sounds logical, but on my second picture the trade touches the trendline from below the bar after it closes. How could that trade have closed at that time? The bar when it closes is nowhere near to the trendline.
02/25/2020 at 5:56 PM #12048902/25/2020 at 5:58 PM #120490If you want to directly exit the order, do not use pending order, but market ones:
SELL AT MARKET
or
EXITSHORT AT MARKET
1 user thanked author for this post.
02/25/2020 at 7:20 PM #12049802/26/2020 at 11:41 AM #120544Thank you Nicolas – that is the solution.
I guess there’s one other thing that has occurred to me that might be an improvement on my entry. Currently my exit rule derives from “if close is > X”… but is there a way of the trade exiting in real time at the moment it breaches the trendline, rather than waiting for the close?
02/26/2020 at 12:35 PM #120548Yes of course – but you have to consider that all orders are created at the close of a candle and at this time we only know what the supertrend level was for that candle that has just closed. The only way to close on the live supertrend value is to use MTF and trade in a faster timeframe while calculating the supertrend in a slower timeframe. Then just use STOP orders in the fast timeframe.
1 user thanked author for this post.
02/26/2020 at 1:16 PM #120557Oh I didn’t realise Multi Time Frame was available. This is good to know!
Thank you. 🙂
02/26/2020 at 2:19 PM #120575The downside of using MTF is that by operating our strategy on a higher time frame we get less data to work with and back test on. The faster we want our strategy to respond the lower the amount of meaningful data we have to play with.
-
AuthorPosts
Find exclusive trading pro-tools on