CAC Breakout ported to DOW
Forums › ProRealTime English forum › General trading discussions › CAC Breakout ported to DOW
- This topic has 4 replies, 2 voices, and was last updated 8 years ago by Nicolas.
-
-
08/30/2016 at 8:10 AM #12436
I thought I would start a new thread for this one as it’s a little different and keeps things a bit more organised. Ok Nicolas?
The DOW did not seem to like the first 30min breakout. This had me stuck for a while so I tried a few different things. It prefers the first hour BUT we exclude the first 15min candle.
Optimised to June 2014 IN/OUT Sample
£1pp Fixed position size. £1000 starting capital. 1.8 Spread.
Let me know your thoughts or if we can improve further.
08/30/2016 at 8:12 AM #1244112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697// We do not store datas until the system starts.// If it is the first day that the system is launched and if it is afternoon,// it will be waiting until the next day for defining sell and buy orders//UK TIME ZONEDEFPARAM PreLoadBars = 0// Position is closed at 20:30DEFPARAM FlatAfter = 203000// No new position will be initiated after the 19:45 candlestickLimitHour = 200000// Market scan begin with the 15 minute candlestick that closed at 15:30StartHour = 151500// The 24th and 31th days of December will not be traded because market close before 7h45 PMIF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) THENTradingDay = 0ELSETradingDay = 1ENDIF// Variables that would be adapted to your preferencesif time = 144500 then//PositionSize = max(2,2+ROUND((strategyprofit-1000)/1000)) //gain re-invest trade volumePositionSize = 1 //constant trade volume over the timeendifMaxAmplitude = 160MinAmplitude = 20OrderDistance = 4PourcentageMin = 35// Variable initilization once at system startONCE StartTradingDay = -1// Variables that can change in intraday are initiliazed// at first bar on each new dayIF (Time <= StartHour AND StartTradingDay <> 0) OR IntradayBarIndex = 0 THENBuyTreshold = 0SellTreshold = 0BuyPosition = 0SellPosition = 0StartTradingDay = 0ELSIF Time >= StartHour AND StartTradingDay = 0 AND TradingDay = 1 THEN// We store the first trading day bar indexDayStartIndex = IntradayBarIndexStartTradingDay = 1ELSIF StartTradingDay = 1 AND Time <= LimitHour THEN// For each trading day, we define each 15 minutes// the higher and lower price value of the instrument since StartHour// until the buy and sell tresholds are not definedIF BuyTreshold = 0 OR SellTreshold = 0 THENHighLevel = Highest[IntradayBarIndex - DayStartIndex + 2](High)LowLevel = Lowest [IntradayBarIndex - DayStartIndex + 2](Low)// Spread calculation between the higher and the// lower value of the instrument since StartHourDaySpread = HighLevel - LowLevel// Minimal spread calculation allowed to consider a significant price breakout// of the higher and lower valueMinSpread = DaySpread * PourcentageMin / 100// Buy and sell tresholds for the actual if conditions are metIF DaySpread <= MaxAmplitude THENIF SellTreshold = 0 AND (Close - LowLevel) >= MinSpread THENSellTreshold = LowLevel + OrderDistanceENDIFIF BuyTreshold = 0 AND (HighLevel - Close) >= MinSpread THENBuyTreshold = HighLevel - OrderDistanceENDIFENDIFENDIF// Creation of the buy and sell orders for the day// if the conditions are metIF SellTreshold > 0 AND BuyTreshold > 0 AND (BuyTreshold - SellTreshold) >= MinAmplitude THENIF BuyPosition = 0 THENIF LongOnMarket THENBuyPosition = 1ELSEBUY PositionSize CONTRACT AT BuyTreshold STOPENDIFENDIFIF SellPosition = 0 THENIF ShortOnMarket THENSellPosition = 1ELSESELLSHORT PositionSize CONTRACT AT SellTreshold STOPENDIFENDIFENDIFENDIF// Conditions definitions to exit market when a buy or sell order is already launchedIF LongOnMarket AND ((Time <= LimitHour AND SellPosition = 1) OR Time > LimitHour) THENSELL AT SellTreshold STOPELSIF ShortOnMarket AND ((Time <= LimitHour AND BuyPosition = 1) OR Time > LimitHour) THENEXITSHORT AT BuyTreshold STOPENDIF// Maximal risk definition of loss per position// in case of bad evolution of the instrument priceSET STOP PLOSS MaxAmplitude//set target pprofit //70 //16008/30/2016 at 5:06 PM #12479Don’t worry, I like things organised too 🙂
Thanks for this new version of the now famous breakout strategy! To have a better clue if the optimized OOS area have the same behaviour of the IS one, you can make a comparison of how much average trades you have on the 2 samples. Once you get that, you can also have a look on trades symmetry comparison : BUY quantity vs SELL quantity ratio.
1 user thanked author for this post.
08/30/2016 at 7:46 PM #1249808/31/2016 at 9:50 AM #12516Well, the trades symmetry seems good between OOS and IS (the first 2 screenshots on the left), the average buy gain is higher though, I believe it is due to 2015 bullish rally on whole indices. Maybe you could test only 2015 period to see what happen between long and short average gain. Good job Cosmic1!
1 user thanked author for this post.
-
AuthorPosts