CAC Breakout ported to other markets
Forums › ProRealTime English forum › ProOrder support › CAC Breakout ported to other markets
- This topic has 37 replies, 10 voices, and was last updated 7 years ago by Despair.
-
-
08/29/2016 at 5:23 PM #12404
Hi, that’s right Nicolas I only optimised the variables above with an IN/OUT sample until beginning 2014 with 200k units (sorry don’t have exact date) The only other addition was the pprofit at the end of the code as it improved things slightly. This is really optional and doesn’t change equity curve/profit that much.
@Smurfy I’m sorry but not sure why you don’t get any trades. Have you adjusted time zones in PRT options as well and they are conflicting?08/29/2016 at 5:43 PM #12406Hi Nicolas! Long vacation for me. I hope also for you!
Actually.. we can optimize also time 😉
08/29/2016 at 6:38 PM #1240908/30/2016 at 8:40 AM #12445Hi Cosmic,
I’m not very sure. I basically just copied your EURUSD copy and make the changes on the timezone that’s all.
however I couldn’t get any trades.
by the way, how do we backtest with a bigger date range? I noticed I couldn’t get it even I specify the date range.
08/30/2016 at 3:49 PM #1246809/01/2016 at 7:57 AM #12534Gosh Sir Nicolas,
I think I’m totally lost in entire coding here. I don’t understand at all how it works.. 🙁
any kind souls can explain on the MaxAmplitude why is it 85 and need to multiply pipsize?
entire strategy is to look at what portion then perform what? So sorry Im really a newbie and super blur…
09/01/2016 at 8:48 AM #12539Because the strategy was first intended to be traded on french CAC40 in points.
MaxAmplitude = 85, means for example 4200 + 85 = 4285 points
But in forex, you got 5 digits and 1 point/1 pip is equal to 0.0001 (EUR/USD pipsize for example)
So if you want to trade it on forex, you need to adapt these values.
09/01/2016 at 1:33 PM #12549Hi Nicolas,
let me digest on this. but the problem is I copied the EURUSD code in this thread and not getting results. Also, I cannot backtest with the dates. Seems like I need to see the dates on the Chart before backtesting can work.
This weekend I will test again.
thanks!
09/02/2016 at 2:15 PM #1260509/02/2016 at 4:33 PM #12612This is my version. I traded it for a while live, but recently I switched completely.
And I changed the Stop Loss Level.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899//Dax 15min 1.2 SPread// 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 ordersDEFPARAM PreLoadBars = 0// Position is closed at 7h45 PM, frenh time (in case of CAC40 trading)DEFPARAM FlatAfter = 173000// No new posit5ion will be initiated after the 5h00 PM candlestickLimitHour = 171500// Market scan begin with the 15 minute candlestick that closed at 9h15 AMStartHour = 091500// The 24th and 31th days of December will not be traded because market close before 7h45 PMIF (month=3 and day=28) or (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 = 084500 thenPositionSize = 1// max(1,1+ROUND((strategyprofit-1000)/1000))//constant trade volume over the timeendifMaxAmplitude = 120MinAmplitude = 30OrderDistance = 6PourcentageMin = 26// 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 + 1](High)LowLevel = Lowest [IntradayBarIndex - DayStartIndex + 1](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 (BuyTreshold - SellTreshold)//SET TARGET pprofit 18009/03/2016 at 8:40 AM #12625@flowsen123 Looks good, I will take a look later. Did you avoid cure fitting?
@smurfy The code that I posted here does work on demo and live. I ran it for two days to make sure and it works as expected without making any modifications or adding * pipsize so I really don’t know what is happening with yours not working. Maybe a call to IG, PRT or both?
@Nicolas I am actually happier posting the DAX one as I have used on demo and live with good results. I am still playing with EUR/USD and analysing. Just submitted DAX to you 🙂09/05/2016 at 6:19 PM #1269405/24/2017 at 1:40 PM #36555Thread resurrection!
I would really like to get these algo’s running again but they have performed poorly since posting to the library, despite my best efforts to avoid curve fitting etc…
I have tried a re opp of the most recent years / months but not really much joy.
Any ideas from you guys? Thoughts?
https://www.prorealcode.com/prorealtime-trading-strategies/dow-breakout-15min/
https://www.prorealcode.com/prorealtime-trading-strategies/breakout-dax-15min/
06/02/2017 at 4:06 AM #37266Hi Cosmic, naturally this algorithm works will in trending markets and as you may have seen recently, not so well in sideways markets. I have reversed the buy/sell commands (effectively trading support/resistance reversals) and the algo does well over the recent sideways period. Now for the million dollar question, how do you determine if the market is trending?
Has anyone done any work in determining trending strength (possibly using rate of change of ADX) and possibly looked at feeding this into this algo?
06/02/2017 at 4:15 PM #37306 -
AuthorPosts
Find exclusive trading pro-tools on