I have the big pleasure of sharing with you the Nasdaq version of the Universal XBody Strategy (which you can find here), with the parameters optimized for this market.
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 48 49 50 51 52 53 |
//------------------------------------------------------------------------- defparam cumulateorders=false //------------------ SYSTEM VARIABLES--------------------------------------- //DAX40 Values: -------------------------------------------- Ottimization info period=878// Optimize best value for each Symbol, range=1-1000, with step=1 mode=1// Optimize the best trading mode , range=1-4, with step=1 invertsignal=1// 1=positive signal, -1=negative signal, range=-1/1, with step=2 //*********************************************************************************************** //------------------ SYSTEM FILTER--------------------------------------- filter1=41// to set after the variable optimization, range=1-100, with step=1 filter2=0// to set after the variable optimization, range=1-100, with step=1 //------------------ INDICATOR --------------------------------------- body=close-open var=(body-body[1]) sumvar=summation[period](var) if sumvar>filter1*pipsize then green=(sumvar) endif if sumvar<-filter2*pipsize then red=(sumvar) endif if mode=1 then c1=red<red[1] c2=green>green[1] endif if mode=2 then c1=red>red[1] c2=green<green[1] endif if mode=3 then c1=red<red[1] c2=green<green[1] endif if mode=4 then c1=red>red[1] c2=green>green[1] endif if c1 then signal=1*invertsignal elsif c2 then signal=-1*invertsignal endif // Conditions for entering long positions and exit short positions IF signal>0 then BUY n contract AT market ENDIF // Conditions for entering short positions and exit long positions IF signal<0 THEN SELLSHORT n CONTRACTs AT market ENDIF |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hello David, can you explain to me this strategy ?
You calculate the difference between the opening and closing of a candlestick, then the difference again from one to another, and you add up this difference over a given period, that’s it ? But if the backtesting gives a period of 854, it means 854 days before ? So, It means more than 3 years ! Thank you
The strategy calculates the variation between the body and the previous body (however in prorealtime strategies the body is equivalent to the body[1] and the body[1] to the body[2]. It then adds this variation for a period of days in the past. This period which is between 1 and 1000 days (by convention) in the past, moves forward with each new closure. There is then a filter which by convention is 0, but can be perfected, which is used to split the aforementioned sum into positive and negative values. There are finally 4 ways in which a bullish or bearish signal can be generated, to be backtested together with the period.
Thanks David it looks great. I am playing with it to get familiar.
Do you think it would be relevant to add a trailing stop once the position becomes a winner ?