Simplified Trailing Stop
Forums › ProRealTime English forum › ProOrder support › Simplified Trailing Stop
- This topic has 6 replies, 4 voices, and was last updated 6 months ago by JS.
-
-
05/10/2024 at 12:52 PM #232525
Hello, after following the discussion on the forum about trailing stops, I think this is way too complicated, so I made a simplified version. We start with a trail stop a few points below our entry price, so that if things start immediately against us, we keep a good mood. If the trade comes our way, the trail stop will be increased. Furthermore, we always sell our trades “at market” so that we do not have to take restrictions from the broker into account (especially when announcing important economic data, for example)
Simpified trail stop1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859Moving stoploss///////////////////////////////////////////////////////////////////////// values for DAX ////////////////////////////////////////////////////////////////////////////SET TARGET pPROFIT 100 // max profitSET STOP pLOSS 35 // max loss///trailing stop functiontrailingstep = 25 // trailing step to move the "stoploss"firstStep = 10 // set newSL at x points under buying price by start//reset the stoploss valueIF NOT ONMARKET THENnewSL=0OpenAtpriceL=1000000OpenAtpriceS=0ENDIF///////////////////////////////////////////////////////////////////////// managing positions /////////////////////////////////////////////////////////////////////////////manage long positionsIF LONGONMARKET THEN//first move (a tiny bit under buying price)IF newSL=0 THENOpenAtPriceL= closenewSL = OpenAtPriceL - firstSTepENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep THENnewSL = newSL+trailingstepENDIFENDIF//manage short positionsIF SHORTONMARKET THENIF newSL=0 THENOpenAtPriceS= closenewSL = OpenAtPriceS + firstSTepENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep THENnewSL = newSL-trailingstepENDIFENDIF// exit the positionsIF newSL>0 and LongOnMarket THENIF close < newSL THENSELL AT MarketENDIFENDIFIF newSL>0 and ShortOnMarket THENIF close > newSL THENEXITSHORT AT MarketENDIFendif1<span class="Y2IQFc" lang="en"> </span>2 users thanked author for this post.
05/10/2024 at 1:27 PM #232528Don’t copy the first line. (1. moving stoploss)
05/10/2024 at 2:18 PM #23252905/10/2024 at 2:41 PM #232531Yes, that is correct
1 user thanked author for this post.
05/12/2024 at 8:27 AM #232563Interesting. I will amend my trailing “stops” without orders at market.
05/12/2024 at 6:18 PM #232587I mean with of course.
05/12/2024 at 8:28 PM #232589Using “market orders” in a trailing stop is fine, but only on a fast time frame… you don’t want to wait too long for your Trailing Stop Market Orders to be executed…
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on