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
//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-Parameter
DEFPARAM 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)<0
streak = positionperf(1)>0 and positionperf(2)>0 and positionperf(3)>0
if losses then
PositionSize = max(abs(round(max(3+risk-2,risk-2))),2)
elsif not losses then
PositionSize = max(abs(round(max(3+risk,risk))),2)
endif
if streak then
PositionSize = max(abs(round(max(5+risk,risk))),2)
endif
//TDI indicator
//parameters :
lengthrsi=13
lengthrsipl=2
lengthtradesl=7
//overbought and oversold values of the TDI indicator
upperzone = 68
lowerzone = 32
//heiken ashi
xClose = (Open+High+Low+Close)/4
if(barindex>2) then
xOpen = (xOpen[1] + xClose[1])/2
xHigh = Max(xOpen, xClose)
xLow = Min(xOpen, xClose)
endif
//indicators
r = rsi[lengthrsi](close)
mab = average[lengthrsipl](r)
mbb = average[lengthtradesl](r)
yellowMA = average[5](TypicalPrice)
yellowMAshifted = yellowMA[2]
//trade conditions
longCondition = mab crosses over mbb AND mab<50 AND xHigh>yellowMAshifted
shortCondition = mab crosses under mbb AND mab>50 AND xLow<yellowMAshifted
Longsell=mab crosses under mbb AND mab<upperzone and mab>50 AND xlow>yellowMAshifted
Shortexit= mab crosses over mbb AND mab>lowerzone and mab<50 AND xhigh>yellowMAshifted
//***************************
// open position
// long
IF Not LONGONMARKET AND longcondition THEN
BUY PositionSize CONTRACT AT MARKET
ENDIF
// short
IF Not SHORTONMARKET AND shortCondition THEN
SELLSHORT PositionSize CONTRACT AT MARKET
ENDIF
// close position
//Longsell
IF LONGONMARKET and Longsell THEN
SELL AT MARKET
ENDIF
//Shortexit
IF SHORTONMARKET and Shortexit THEN
EXITSHORT AT MARKET
ENDIF
// stop and profit
//SET STOP pLOSS sl
//SET TARGET pPROFIT tp
Thank you for this strategy. What is your problem with the post on Library please? Do you get an error or something?
Hi 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 😉
I 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
Why 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!?