can´t believe backtest works only on Dax 1 Euro Spread 2 Euro, test from 01.01.2013 result ~ 350% maybe comes little help too //------------------------------------------------------------------------- // Hauptcode : EA Head PF flat friday 210000 //------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- // EA Head V.1 // EA Head H4 live PF // created by JohnScher with help by ProRealCode // Simple EMA-Strategy, timebased, mixed with some filters and a turbo by pathfinder-systems // Dax 1 Euro Mini, 2 Points Spread, backtested 01.01.2013 to 29.07.2017 with positiv results //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- // defparam flatafter = 210000 is possibel, if used: winnings are smaller, risks are smaller // Start Pathfinder-System // Pathfinder-System not coded by me, code found at ProRealCode // with define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade) ONCE January1 = 3 //0 risk(3) ONCE January2 = 0 //3 ok ONCE February1 = 3 //3 ok ONCE February2 = 3 //0 risk(3) ONCE March1 = 3 //0 risk(3) ONCE March2 = 2 //3 ok ONCE April1 = 3 //3 ok ONCE April2 = 3 //3 ok ONCE May1 = 1 //0 risk(1) ONCE May2 = 1 //0 risk(1) ONCE June1 = 1 //1 ok 2 ONCE June2 = 2 //3 ok ONCE July1 = 3 //1 chance ONCE July2 = 2 //3 ok ONCE August1 = 2 //1 chance 1 ONCE August2 = 3 //3 ok ONCE September1 = 3 //0 risk(3) ONCE September2 = 0 //0 ok ONCE October1 = 3 //0 risk(3) ONCE October2 = 2 //3 ok ONCE November1 = 1 //1 ok ONCE November2 = 3 //3 ok ONCE December1 = 3 // 1 chance ONCE December2 = 2 //3 ok // set saisonal multiplier currentDayOfTheMonth = Day midOfMonth = 15 IF CurrentMonth = 1 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = January1 ELSE saisonalPatternMultiplier = January2 ENDIF ELSIF CurrentMonth = 2 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = February1 ELSE saisonalPatternMultiplier = February2 ENDIF ELSIF CurrentMonth = 3 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = March1 ELSE saisonalPatternMultiplier = March2 ENDIF ELSIF CurrentMonth = 4 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = April1 ELSE saisonalPatternMultiplier = April2 ENDIF ELSIF CurrentMonth = 5 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = May1 ELSE saisonalPatternMultiplier = May2 ENDIF ELSIF CurrentMonth = 6 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = June1 ELSE saisonalPatternMultiplier = June2 ENDIF ELSIF CurrentMonth = 7 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = July1 ELSE saisonalPatternMultiplier = July2 ENDIF ELSIF CurrentMonth = 8 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = August1 ELSE saisonalPatternMultiplier = August2 ENDIF ELSIF CurrentMonth = 9 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = September1 ELSE saisonalPatternMultiplier = September2 ENDIF ELSIF CurrentMonth = 10 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = October1 ELSE saisonalPatternMultiplier = October2 ENDIF ELSIF CurrentMonth = 11 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = November1 ELSE saisonalPatternMultiplier = November2 ENDIF ELSIF CurrentMonth = 12 THEN IF currentDayOfTheMonth <= midOfMonth THEN saisonalPatternMultiplier = December1 ELSE saisonalPatternMultiplier = December2 ENDIF Endif // in original Pathfinder-Systems was used to find out correkt positionsize see following // period = 14 // atr = AverageTrueRange[period] // position = round(100/atr/2.1666) // here i used position = 1 // End Pathfinder-System //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- // Code Indicator NR7 // just info to integrated on your workstation //----------------------------------------------------------------------------------------------------------------------- // C1= Range<Range[1] and Range<Range[2] and Range<Range[3] and Range<Range[4] and Range<Range[5] and Range<Range[6] and Range<Range[7] // RETURN C1 //----------------------------------------------------------------------------------------------------------------------- // End Code Indicator Nr7 //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- // Start Maincode // Maincode : EA Head H4 Live PF //----------------------------------------------------------------------------------------------------------------------- // Filter // not proofed for example : williams, atr, .... // maybe the filters are not in the best settings, but it works in this way //------------------------------------------------------------------------- // Code Indicator : nr7 //C1= Range<Range[1] and Range<Range[2] and Range<Range[3] and Range<Range[4] and Range<Range[5] and Range<Range[6] and Range<Range[7] //RETURN C1 //------------------------------------------------------------------------- cx = CALL "NR7" cx1 = cci[11]<80 cx2 = cci[21]>-90 cx3 = Momentum[6](close)>0 cx4 = ADX[11] >15 // cx5 = MoneyFlow[11](close)<0 (not used, maybe for optimizing cx6 = TR(close) >25 cx7 = PVT(close)<1 cx8 = EaseOfMovement[14]<95 cx9 = SmoothedStochastic[14,3](close)<95 cx10 = PriceOscillator[5,25](close)<0.5 cx11 = LinearRegressionSlope[10](close)>-14 cx12 = AccumDistr(close)>-0.1 cx13 = Chandle [21](close)>-51 cx14 = STD[6](close)<99 //not used for example williams, rsi and so one to get out the tops on losses // end filter // timebase TradingDayShort = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5 TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5 TradingTimeShort = time = 090000 or time = 130000 or time = 170000 TradingtimeLong = time = 090000 or time = 130000 or time = 170000 // end timebase // EMA Strategy with integrated Pathfinder-System, Filter and Timebase // Short-Trade IF TradingDayShort and TradingTimeShort Then If not cx Then If cx1 and cx4 and cx7 and cx8 and cx9 and cx10 and cx12 and cx14 Then If ExponentialAverage [1] (close) < ExponentialAverage [2] (close) Then sellshort position*saisonalPatternMultiplier CONTRACTS AT MARKET Endif Endif Endif ENDIF // better to set (needed) : exitshort at end of regular weekly trading-hours IF dayofweek = 5 and time = 210000 Then ExitShort at market ENDIF // Long-Trade IF TradingDayLong and TradingTimeLong Then If cx2 and cx3 and cx6 and cx11 and cx13 Then If ExponentialAverage [1] (close) > ExponentialAverage [8] (close) THEN buy position*saisonalPatternMultiplier CONTRACT AT MARKET Endif Endif ENDIF // better to set (needed) : sell at end of regular weekly trading-hours IF dayofweek = 5 and time = 210000 Then sell at market ENDIF // can be optimezed // if i test only long trades i find long: SL 0.75% and TP 1.5% more effectiv // in test only short trades i find Short: SL 1.0% and TP 2.4% more effektiv Set Stop %Loss 1 Set Target %Profit 2 // End EMA-Strategy, End Main-Code //----------------------------------------------------------------------------------------------------------------------- //not integrated any strategyprofit-maximize-strategy like re-invest-strategies, maybe some help to integrate this ? //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- // kind regards JohnScher