Heiken Ashi TMS/TDI strategy
Forums › ProRealTime English forum › ProRealTime platform support › Heiken Ashi TMS/TDI strategy
- This topic has 4 replies, 4 voices, and was last updated 4 years ago by GraHal.
-
-
08/05/2016 at 6:50 PM #11255
Hi guys. I will try and post the code here as it did not post in the strategy sections. Perhaps it better here so it up for a discussions. It is based on several codes from the site, but mainly the TDI and TMS from both Nicolas and Reiner. I changed the strategy a bit so it fits the Oil- Brent Crude. It seems like that every strategy that I test need to be “adjusted” to the particular instrument. Does anyone do the same, or do you strictly keep the rule? Anyway the code has no zero bar profit, nor does it have SL or TP coded- in fact it has only 15 trades over 3 month. It could be more “perfect” as there are some entries that could be more profitable. Unfortunately I can only backtest it 3 month- apparently IG only hold 3 month of data for Crude Oil(?) It’s tested with a 3 point spread. Anyway here it is, please comment 🙂
Cheers
Kasper
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586//TDI OIL 2H elsborgtrading// based on Trend Surfer DAX-Reiner/Nicholas-TMS//http://www.prorealcode.com/prorealtime-trading-strategies/trend-surfer-dax///http://www.prorealcode.com/topic/trading-made-simple-tms-system///http://www.forexmt4.com/_MT4_Systems/Traders%20Dynamics/TDI_1.pdf// code-ParameterDEFPARAM CumulateOrders = true//DEFPARAM FlatAfter = 230000//DEFPARAM Flatbefore = 030000//MONEY MGT//Equity = (Strategyprofit+20000)Risk = round(Equity/100000)Losses = positionperf(1)<0 and positionperf(2)<0 and positionperf(3)<0streak = positionperf(1)>0 and positionperf(2)>0 and positionperf(3)>0if losses thenPositionSize = max(abs(round(max(3+risk-2,risk-2))),2)elsif not losses thenPositionSize = max(abs(round(max(3+risk,risk))),2)endifif streak thenPositionSize = max(abs(round(max(5+risk,risk))),2)endif//TDI indicator//parameters :lengthrsi=13lengthrsipl=2lengthtradesl=7//overbought and oversold values of the TDI indicatorupperzone = 68lowerzone = 32//heiken ashixClose = (Open+High+Low+Close)/4if(barindex>2) thenxOpen = (xOpen[1] + xClose[1])/2xHigh = Max(xOpen, xClose)xLow = Min(xOpen, xClose)endif//indicatorsr = rsi[lengthrsi](close)mab = average[lengthrsipl](r)mbb = average[lengthtradesl](r)yellowMA = average[5](TypicalPrice)yellowMAshifted = yellowMA[2]//trade conditionslongCondition = mab crosses over mbb AND mab<50 AND xHigh>yellowMAshiftedshortCondition = mab crosses under mbb AND mab>50 AND xLow<yellowMAshiftedLongsell=mab crosses under mbb AND mab<upperzone and mab>50 AND xlow>yellowMAshiftedShortexit= mab crosses over mbb AND mab>lowerzone and mab<50 AND xhigh>yellowMAshifted//***************************// open position// longIF Not LONGONMARKET AND longcondition THENBUY PositionSize CONTRACT AT MARKETENDIF// shortIF Not SHORTONMARKET AND shortCondition THENSELLSHORT PositionSize CONTRACT AT MARKETENDIF// close position//LongsellIF LONGONMARKET and Longsell THENSELL AT MARKETENDIF//ShortexitIF SHORTONMARKET and Shortexit THENEXITSHORT AT MARKETENDIF// stop and profit//SET STOP pLOSS sl//SET TARGET pPROFIT tp08/05/2016 at 9:13 PM #1125808/05/2016 at 9:21 PM #11259Hi Nicolas. No i did not get any error, I hit the post button but nothing ever happened. no confirmation and I think I hit the back button, and the post was gone, and never was published. I thought it maybe should be validated before published by admin(you) or something? Properly just a glitch in the Matrix 😉
05/12/2020 at 4:34 PM #131341I have looked on this strat for a while now and I feel like with a good sl and tp it could get really good. Just wanted to bump it so more people can see it and work on it. (old post)
Thanks @Elsborgtrading
05/13/2020 at 4:11 PM #131516Why not backtest the strategy and post the equity curve and the performance stats … to get us interested?
Walk Forward results also .. even better?
Robustness Test results also … better still?? 🙂
Monte Carlo results also … wow great job!! 🙂 🙂
Any more for any more??
Sorry I’m in a mad mood, lonely life trading!?
-
AuthorPosts
Find exclusive trading pro-tools on