Forums › ProRealTime English forum › ProOrder support › Optimisation Fails? › Reply To: Optimisation Fails?
04/03/2019 at 4:06 PM
#95421
Yeah.. it’s not the internet connection and the backtest fails half way through optimisation 100% of the time because of the Bull Bear ALMA indicator being used on the Entry. I just used another entry and it will optimise the number of days before exiting the position.
Does anyone know what specifically is causing the issue with the indicator?
Thanks,
Bull/Bear ALMA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
//Bear 20% w. ALMA // 20% Bull/Bear Market increase/decrease in Prices //DEFPARAM CalculateOnLastBars = 5000 Period = 50 //start with 50 periods Series = customclose FOR j = 1 TO 3 Sigma = 6 Offset = 0.85 m = ROUND(Offset * (Period - 1)) s = Period / Sigma WtdSum = 0 CumWt = 0 FOR k = 0 TO Period - 1 DO Wtd = EXP(-((k - m) * (k - m)) / (2 * s * s)) WtdSum = WtdSum + Wtd * Series[Period - 1 - k] CumWt = CumWt + Wtd NEXT IF CumWt <= 0 THEN AFR = Series ELSE AFR = WtdSum / CumWt ENDIF IF j = 1 THEN ShortMA = AFR ELSIF j = 2 THEN MediumMA = AFR ELSE LongMA = AFR ENDIF Period = Period * 2 //double periods NEXT // 20% Bull Market increase in Prices BullC1 = Close[0] > ShortMA BullC2 = Close[0] > MediumMA BullC3 = Close[0] > LongMA BullC4 = Close[0] >= (Close[200] * 1.2) // 20% Bear Market decrease in Prices BearC5 = Close[0] < ShortMA BearC6 = Close[0] < MediumMA BearC7 = Close[0] < LongMA BearC8 = Close[0] <= (Close[200] * 1.2) Return BullC1 and BullC2 and BullC3 and BullC4 as "Bull Market", -(BearC5 and BearC6 and BearC7 and BearC8) as "Bear Market",0 |