EA Head
Forums › ProRealTime English forum › ProOrder support › EA Head
- This topic has 15 replies, 4 voices, and was last updated 7 years ago by
JohnScher.
-
-
07/29/2017 at 4:07 PM #41959
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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241//-------------------------------------------------------------------------// 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 okONCE February1 = 3 //3 okONCE February2 = 3 //0 risk(3)ONCE March1 = 3 //0 risk(3)ONCE March2 = 2 //3 okONCE April1 = 3 //3 okONCE April2 = 3 //3 okONCE May1 = 1 //0 risk(1)ONCE May2 = 1 //0 risk(1)ONCE June1 = 1 //1 ok 2ONCE June2 = 2 //3 okONCE July1 = 3 //1 chanceONCE July2 = 2 //3 okONCE August1 = 2 //1 chance 1ONCE August2 = 3 //3 okONCE September1 = 3 //0 risk(3)ONCE September2 = 0 //0 okONCE October1 = 3 //0 risk(3)ONCE October2 = 2 //3 okONCE November1 = 1 //1 okONCE November2 = 3 //3 okONCE December1 = 3 // 1 chanceONCE December2 = 2 //3 ok// set saisonal multipliercurrentDayOfTheMonth = DaymidOfMonth = 15IF CurrentMonth = 1 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = January1ELSEsaisonalPatternMultiplier = January2ENDIFELSIF CurrentMonth = 2 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = February1ELSEsaisonalPatternMultiplier = February2ENDIFELSIF CurrentMonth = 3 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = March1ELSEsaisonalPatternMultiplier = March2ENDIFELSIF CurrentMonth = 4 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = April1ELSEsaisonalPatternMultiplier = April2ENDIFELSIF CurrentMonth = 5 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = May1ELSEsaisonalPatternMultiplier = May2ENDIFELSIF CurrentMonth = 6 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = June1ELSEsaisonalPatternMultiplier = June2ENDIFELSIF CurrentMonth = 7 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = July1ELSEsaisonalPatternMultiplier = July2ENDIFELSIF CurrentMonth = 8 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = August1ELSEsaisonalPatternMultiplier = August2ENDIFELSIF CurrentMonth = 9 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = September1ELSEsaisonalPatternMultiplier = September2ENDIFELSIF CurrentMonth = 10 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = October1ELSEsaisonalPatternMultiplier = October2ENDIFELSIF CurrentMonth = 11 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = November1ELSEsaisonalPatternMultiplier = November2ENDIFELSIF CurrentMonth = 12 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = December1ELSEsaisonalPatternMultiplier = December2ENDIFEndif// 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 usedposition = 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]<80cx2 = cci[21]>-90cx3 = Momentum[6](close)>0cx4 = ADX[11] >15// cx5 = MoneyFlow[11](close)<0 (not used, maybe for optimizingcx6 = TR(close) >25cx7 = PVT(close)<1cx8 = EaseOfMovement[14]<95cx9 = SmoothedStochastic[14,3](close)<95cx10 = PriceOscillator[5,25](close)<0.5cx11 = LinearRegressionSlope[10](close)>-14cx12 = AccumDistr(close)>-0.1cx13 = Chandle [21](close)>-51cx14 = STD[6](close)<99//not used for example williams, rsi and so one to get out the tops on losses// end filter// timebaseTradingDayShort = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5TradingTimeShort = time = 090000 or time = 130000 or time = 170000TradingtimeLong = time = 090000 or time = 130000 or time = 170000// end timebase// EMA Strategy with integrated Pathfinder-System, Filter and Timebase// Short-TradeIF TradingDayShort and TradingTimeShort ThenIf not cx ThenIf cx1 and cx4 and cx7 and cx8 and cx9 and cx10 and cx12 and cx14 ThenIf ExponentialAverage [1] (close) < ExponentialAverage [2] (close) Thensellshort position*saisonalPatternMultiplier CONTRACTS AT MARKETEndifEndifEndifENDIF// better to set (needed) : exitshort at end of regular weekly trading-hoursIF dayofweek = 5 and time = 210000 ThenExitShort at marketENDIF// Long-TradeIF TradingDayLong and TradingTimeLong ThenIf cx2 and cx3 and cx6 and cx11 and cx13 ThenIf ExponentialAverage [1] (close) > ExponentialAverage [8] (close) THENbuy position*saisonalPatternMultiplier CONTRACT AT MARKETEndifEndifENDIF// better to set (needed) : sell at end of regular weekly trading-hoursIF dayofweek = 5 and time = 210000 Thensell at marketENDIF// 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 effektivSet Stop %Loss 1Set 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 JohnScher07/29/2017 at 4:34 PM #4196008/07/2017 at 11:02 AM #4265908/07/2017 at 2:04 PM #42672I think you can add the NR7 code like this (replace the line 168 with this one):
1cx = 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]I did not test this strategy myself, but it seems over optimized, John didn’t explained us how he found all these variables values and indicators periods.
08/08/2017 at 2:17 PM #42758can we see a screenshot of the statistics of the backtest?
Thanks
Francesco
08/09/2017 at 7:34 PM #42819my problem is: can i believe the backtest… ?
results are good, but too good
code little bit more fine
see on yourself
so my question, can you controll the result on backtest?
timeframe 4h, start 01.01.2013 until today, Dax 1 Euro mini, spread = 2, no brokerage few
do i right put the screenshots?
can’t print the details as screenshot, find no “safe as” button .. how it works?
EA Head V1.2123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180//-------------------------------------------------------------------------// Hauptcode : EA Head V1.2// created by JohnScher, coded with help from ProRealTime//-------------------------------------------------------------------------// Start Pathfinder-System// with define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)defparam flatafter = 210000ONCE January1 = 3 //0 risk(3)ONCE January2 = 0 //3 okONCE February1 = 3 //3 okONCE February2 = 3 //0 risk(3)ONCE March1 = 3 //0 risk(3)ONCE March2 = 2 //3 okONCE April1 = 3 //3 okONCE April2 = 3 //3 okONCE May1 = 1 //0 risk(1)ONCE May2 = 1 //0 risk(1)ONCE June1 = 1 //1 ok 2ONCE June2 = 2 //3 okONCE July1 = 3 //1 chanceONCE July2 = 2 //3 okONCE August1 = 2 //1 chance 1ONCE August2 = 3 //3 okONCE September1 = 3 //0 risk(3)ONCE September2 = 0 //0 okONCE October1 = 3 //0 risk(3)ONCE October2 = 2 //3 okONCE November1 = 1 //1 okONCE November2 = 3 //3 okONCE December1 = 3 // 1 chanceONCE December2 = 2 //3 ok// set saisonal multipliercurrentDayOfTheMonth = DaymidOfMonth = 15IF CurrentMonth = 1 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = January1ELSEsaisonalPatternMultiplier = January2ENDIFELSIF CurrentMonth = 2 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = February1ELSEsaisonalPatternMultiplier = February2ENDIFELSIF CurrentMonth = 3 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = March1ELSEsaisonalPatternMultiplier = March2ENDIFELSIF CurrentMonth = 4 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = April1ELSEsaisonalPatternMultiplier = April2ENDIFELSIF CurrentMonth = 5 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = May1ELSEsaisonalPatternMultiplier = May2ENDIFELSIF CurrentMonth = 6 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = June1ELSEsaisonalPatternMultiplier = June2ENDIFELSIF CurrentMonth = 7 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = July1ELSEsaisonalPatternMultiplier = July2ENDIFELSIF CurrentMonth = 8 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = August1ELSEsaisonalPatternMultiplier = August2ENDIFELSIF CurrentMonth = 9 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = September1ELSEsaisonalPatternMultiplier = September2ENDIFELSIF CurrentMonth = 10 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = October1ELSEsaisonalPatternMultiplier = October2ENDIFELSIF CurrentMonth = 11 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = November1ELSEsaisonalPatternMultiplier = November2ENDIFELSIF CurrentMonth = 12 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = December1ELSEsaisonalPatternMultiplier = December2ENDIFEndifposition = 2// End Pathfinder-System//-------------------------------------------------------------------------//-------------------------------------------------------------------------// 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//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Start maincode//-------------------------------------------------------------------------// maincode : H4 Live//-------------------------------------------------------------------------//-------------------------------------------------------------------------//-------------------------------------------------------------------------//-------------------------------------------------------------------------cx1 = cci[11]<90cx2 = cci[21]>-90cx3 = Momentum[12](close)>0cx4 = ADX[11] >14// cx5 = MoneyFlow[11](close)<0cx6 = TR(close) >14//cx7 = PVT(close)<1cx8 = EaseOfMovement[14]<70cx9 = SmoothedStochastic[21,3](close)<90cx10 = PriceOscillator[5,25](close)<0.5cx11 = LinearRegressionSlope[12](close)>-14cx12 = AccumDistr(close)>-0.1cx13 = Chandle [21](close)>-21cx14 = STD[6](close)<99cx15 = Chandle [6] (close)<49cx16 = RSI[6](close)<51cx17 = RSI[6](close)>49TradingDayShort = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayofweek = 5TradingTimeShort = time = 090000 or time = 130000 or time = 170000TradingtimeLong = time = 090000 or Time = 130000 or time = 170000IF TradingDayShort and TradingTimeShort ThenIF cx1 and cx4 and cx8 and cx9 and cx10 and cx12 and cx14 and cx15 and cx16 ThenIF ExponentialAverage [1] (close) < ExponentialAverage [8] (close) THENsellshort position*saisonalPatternMultiplier CONTRACTS AT MARKETENDIFEndifEndifIF TradingDayLong and TradingTimeLong ThenIF cx2 and cx3 and cx6 and cx11 and cx13 and cx17 ThenIF ExponentialAverage [1] (close) > ExponentialAverage [6] (close) THENbuy position*saisonalPatternMultiplier CONTRACT AT MARKETENDIFEndifEndifSet Stop %Loss 3Set Target %profit 3// to be optimize// kind JohnScher08/09/2017 at 7:36 PM #4282108/09/2017 at 7:39 PM #4282208/09/2017 at 7:55 PM #42823try this too as backtest
Short Trades in a rising market
EA only Short123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180//-------------------------------------------------------------------------// Hauptcode : H4 live cxxxx last PF flat2100//-------------------------------------------------------------------------// Start Pathfinder-System// with define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)defparam flatafter = 210000ONCE January1 = 3 //0 risk(3)ONCE January2 = 1 //3 okONCE February1 = 3 //3 okONCE February2 = 3 //0 risk(3)ONCE March1 = 3 //0 risk(3)ONCE March2 = 2 //3 okONCE April1 = 3 //3 okONCE April2 = 3 //3 okONCE May1 = 1 //0 risk(1)ONCE May2 = 1 //0 risk(1)ONCE June1 = 1 //1 ok 2ONCE June2 = 2 //3 okONCE July1 = 3 //1 chanceONCE July2 = 2 //3 okONCE August1 = 2 //1 chance 1ONCE August2 = 3 //3 okONCE September1 = 3 //0 risk(3)ONCE September2 = 1 //0 okONCE October1 = 3 //0 risk(3)ONCE October2 = 2 //3 okONCE November1 = 1 //1 okONCE November2 = 3 //3 okONCE December1 = 3 // 1 chanceONCE December2 = 2 //3 ok// set saisonal multipliercurrentDayOfTheMonth = DaymidOfMonth = 15IF CurrentMonth = 1 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = January1ELSEsaisonalPatternMultiplier = January2ENDIFELSIF CurrentMonth = 2 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = February1ELSEsaisonalPatternMultiplier = February2ENDIFELSIF CurrentMonth = 3 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = March1ELSEsaisonalPatternMultiplier = March2ENDIFELSIF CurrentMonth = 4 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = April1ELSEsaisonalPatternMultiplier = April2ENDIFELSIF CurrentMonth = 5 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = May1ELSEsaisonalPatternMultiplier = May2ENDIFELSIF CurrentMonth = 6 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = June1ELSEsaisonalPatternMultiplier = June2ENDIFELSIF CurrentMonth = 7 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = July1ELSEsaisonalPatternMultiplier = July2ENDIFELSIF CurrentMonth = 8 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = August1ELSEsaisonalPatternMultiplier = August2ENDIFELSIF CurrentMonth = 9 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = September1ELSEsaisonalPatternMultiplier = September2ENDIFELSIF CurrentMonth = 10 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = October1ELSEsaisonalPatternMultiplier = October2ENDIFELSIF CurrentMonth = 11 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = November1ELSEsaisonalPatternMultiplier = November2ENDIFELSIF CurrentMonth = 12 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = December1ELSEsaisonalPatternMultiplier = December2ENDIFEndifposition = 2// End Pathfinder-System//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Start 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//-------------------------------------------------------------------------// End Code IndicatorNr7//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Start Hauptcode//-------------------------------------------------------------------------// Hauptcode : H4 Live//-------------------------------------------------------------------------//-------------------------------------------------------------------------//-------------------------------------------------------------------------//-------------------------------------------------------------------------cx1 = cci[11]<90//cx2 = cci[21]>-90//cx3 = Momentum[12](close)>0cx4 = ADX[11] >14//cx5 = MoneyFlow[14](close)>0//cx6 = TR(close) >14//cx7 = PVT(close)<1cx8 = EaseOfMovement[14]<70cx9 = SmoothedStochastic[21,3](close)<90cx10 = PriceOscillator[5,25](close)<0.5//cx11 = LinearRegressionSlope[12](close)>-14cx12 = AccumDistr(close)>-0.1//cx13 = Chandle [21](close)>-21cx14 = STD[6](close)<99cx15 = Chandle [14] (close)<49cx16 = RSI[6](close)<51//cx17 = RSI[6](close)>49cx18 = Chandle[12](close)>-21cx19 = Williams[14](close)<-29cx20 = Repulse[6](close)<-0.22cx21 = MassIndex[12]>10TradingDayShort = 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 = 5TradingTimeShort = time = 090000 or time = 130000 or time = 170000//TradingtimeLong = time = 090000 or Time = 130000 or time = 170000IF TradingDayShort and TradingTimeShort ThenIF cx1 and cx4 and cx8 and cx9 and cx10 and cx12 and cx14 and cx15 and cx16 and cx18 and cx19 and cx20 and cx21 ThenIF ExponentialAverage [1] (close) < ExponentialAverage [4] (close) THENsellshort position*saisonalPatternMultiplier CONTRACTS AT MARKETENDIFEndifEndifIF ShortonMarket ThenSet Stop %Loss 3Set Target %Profit 3Endif//IF TradingDayLong and TradingTimeLong Then//IF cx2 and cx3 and cx5 and cx6 and cx11 and cx13 and cx15 and cx17 Then//IF ExponentialAverage [1] (close) > ExponentialAverage [8] (close) THEN//buy position*saisonalPatternMultiplier CONTRACT AT MARKET//ENDIF//Endif//Endif//IF Longonmarket then//Set Stop %Loss 1//Set Target %profit 1//Endif08/10/2017 at 9:33 AM #42845Thank you John, I received also your post in the library pending review list. I may be wrong, but I think you have optimized many variables (indicators’periods and levels), am I right? In this case, did you test also the best values in OOS (Out Of Sample) periods? Now that is available, you can use Walk Forward optimiser which help you find the good edge between over optimized strategy and robust one.
The fact is that the result of your backtest is, as you stated, “unbelievable”, because it is like you use the best suitable values for things you know already how they will happen.
08/10/2017 at 9:40 AM #4284808/10/2017 at 12:54 PM #42907The strategy seems quite overfitted on past price behaviour. I encourage you reading these articles:
In this first one, you’ll learn about In Sample and Out Of Sample testing methodology:
This one is the extract of the proorder documentation about the new tool (walk forward analysis):
https://www.prorealcode.com/blog/learning/strategy-optimisation-walk-analysis/
Another post I made, as a FAQ for the Walk Forward tool (made of pieces from different discussions here and there on forums):
https://www.prorealcode.com/blog/learning/prorealtime-walk-analysis-tool/
08/11/2017 at 11:20 AM #43013Hello Nikolas.
Thanks so lot.
I have integrate EA Head and “Short on rising markets” in Demo-Account on PRT.
I ll give response, after 10 Trades run out. I ll give response about the match of the backtest results with the demo results too.
Dito EA Head.
So far so good.
best regards
08/17/2017 at 9:05 PM #4414708/17/2017 at 9:38 PM #44152the code i use
copy paste
Storm123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183//-------------------------------------------------------------------------// Hauptcode : Short in a rising market//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Hauptcode : H4 live cxxxx last PF flat2100//-------------------------------------------------------------------------// Start Pathfinder-System// with define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)defparam flatafter = 210000ONCE January1 = 3 //0 risk(3)ONCE January2 = 1 //3 okONCE February1 = 3 //3 okONCE February2 = 3 //0 risk(3)ONCE March1 = 3 //0 risk(3)ONCE March2 = 2 //3 okONCE April1 = 3 //3 okONCE April2 = 3 //3 okONCE May1 = 1 //0 risk(1)ONCE May2 = 1 //0 risk(1)ONCE June1 = 1 //1 ok 2ONCE June2 = 2 //3 okONCE July1 = 3 //1 chanceONCE July2 = 2 //3 okONCE August1 = 2 //1 chance 1ONCE August2 = 3 //3 okONCE September1 = 3 //0 risk(3)ONCE September2 = 1 //0 okONCE October1 = 3 //0 risk(3)ONCE October2 = 2 //3 okONCE November1 = 1 //1 okONCE November2 = 3 //3 okONCE December1 = 3 // 1 chanceONCE December2 = 2 //3 ok// set saisonal multipliercurrentDayOfTheMonth = DaymidOfMonth = 15IF CurrentMonth = 1 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = January1ELSEsaisonalPatternMultiplier = January2ENDIFELSIF CurrentMonth = 2 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = February1ELSEsaisonalPatternMultiplier = February2ENDIFELSIF CurrentMonth = 3 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = March1ELSEsaisonalPatternMultiplier = March2ENDIFELSIF CurrentMonth = 4 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = April1ELSEsaisonalPatternMultiplier = April2ENDIFELSIF CurrentMonth = 5 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = May1ELSEsaisonalPatternMultiplier = May2ENDIFELSIF CurrentMonth = 6 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = June1ELSEsaisonalPatternMultiplier = June2ENDIFELSIF CurrentMonth = 7 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = July1ELSEsaisonalPatternMultiplier = July2ENDIFELSIF CurrentMonth = 8 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = August1ELSEsaisonalPatternMultiplier = August2ENDIFELSIF CurrentMonth = 9 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = September1ELSEsaisonalPatternMultiplier = September2ENDIFELSIF CurrentMonth = 10 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = October1ELSEsaisonalPatternMultiplier = October2ENDIFELSIF CurrentMonth = 11 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = November1ELSEsaisonalPatternMultiplier = November2ENDIFELSIF CurrentMonth = 12 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = December1ELSEsaisonalPatternMultiplier = December2ENDIFEndifposition = 2// End Pathfinder-System//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Start 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//-------------------------------------------------------------------------// End Code IndicatorNr7//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Start Hauptcode//-------------------------------------------------------------------------// Hauptcode : H4 Live//-------------------------------------------------------------------------//-------------------------------------------------------------------------//-------------------------------------------------------------------------//-------------------------------------------------------------------------cx1 = cci[11]<90//cx2 = cci[21]>-90//cx3 = Momentum[12](close)>0cx4 = ADX[11] >14//cx5 = MoneyFlow[14](close)>0//cx6 = TR(close) >14//cx7 = PVT(close)<1cx8 = EaseOfMovement[14]<70cx9 = SmoothedStochastic[21,3](close)<90cx10 = PriceOscillator[5,25](close)<0.5//cx11 = LinearRegressionSlope[12](close)>-14cx12 = AccumDistr(close)>-0.1//cx13 = Chandle [21](close)>-21cx14 = STD[6](close)<99cx15 = Chandle [14] (close)<49cx16 = RSI[6](close)<51//cx17 = RSI[6](close)>49cx18 = Chandle[12](close)>-21cx19 = Williams[14](close)<-29cx20 = Repulse[6](close)<-0.22cx21 = MassIndex[12]>10TradingDayShort = 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 = 5TradingTimeShort = time = 090000 or time = 130000 or time = 170000//TradingtimeLong = time = 090000 or Time = 130000 or time = 170000IF TradingDayShort and TradingTimeShort ThenIF cx1 and cx4 and cx8 and cx9 and cx10 and cx12 and cx14 and cx15 and cx16 and cx18 and cx19 and cx20 and cx21 ThenIF ExponentialAverage [1] (close) < ExponentialAverage [4] (close) THENsellshort position*saisonalPatternMultiplier CONTRACTS AT MARKETENDIFEndifEndifIF ShortonMarket ThenSet Stop %Loss 3Set Target %Profit 3Endif//IF TradingDayLong and TradingTimeLong Then//IF cx2 and cx3 and cx5 and cx6 and cx11 and cx13 and cx15 and cx17 Then//IF ExponentialAverage [1] (close) > ExponentialAverage [8] (close) THEN//buy position*saisonalPatternMultiplier CONTRACT AT MARKET//ENDIF//Endif//Endif//IF Longonmarket then//Set Stop %Loss 1//Set Target %profit 1//Endif1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on