Traders,
I have been working on the Trend Chaser concept for some time but always had a problem with false signals, large draw-downs, and sub-optimal stops. It had value in that it averages 50% wins on most instruments with most time-frames, so I felt it was worth persevering.
I am indebted to cfta’s idea for grid-step trading and Nicolas’ assistance and development of the code for a brilliant money-management system, as well a number of traders (and my close friend Free2Trade) for their encouragement and ideas. I have been able to find a solution to these problems through the incorporate the money management code with the Trend Chaser code.
It is early days in the testing but so far the results have been spectacular. I have attached a spreadsheet of the test results I have run on major indices, with the optimisation of some of the money management parameters: standard deviation (line 73), risk/reward (line 11) and risk percent (line 9). Please note that the formula in the spreadsheet are:
I find that the sweet spot for the code is in the shorter time frames such as 5 and 1 minute charts. The last two tests of the DAX were spectacular as I ran them over only the opening hours for that market. The negatives were the draw-downs of 11% and 17% – worth the risk, Elsborgtrading????
I have attached the code for examination and critique, please. All comments and suggestions for improvement are most welcome.
/// Definition of code parameters
defparam preloadbars = 3000
DEFPARAM CumulateOrders = false // Cumulating positions deactivated
COI= WEIGHTEDAVERAGE[14](ROC[11] +ROC[10])
MAC= MACDline[12,26,9]
STO = Stochastic[14,5]
once RRreached = 0
accountbalance = 10000 //account balance in money at strategy start
riskpercent = rp //whole account risk in percent%
amount = 1 //lot amount to open each trade
rr = rr //risk reward ratio (set to 0 disable this function)
//dynamic step grid
minSTEP = 5 //minimal step of the grid
maxSTEP = 20 //maximal step of the grid
ATRcurrentPeriod = 5 //recent volatility 'instant' period
ATRhistoPeriod = 100 //historical volatility period
ATR = averagetruerange[ATRcurrentPeriod]
histoATR= highest[ATRhistoPeriod](ATR)
resultMAX = MAX(minSTEP*pipsize,histoATR - ATR)
resultMIN = MIN(resultMAX,maxSTEP*pipsize)
gridstep = (resultMIN)
// Conditions to enter long positions
c1 = (COI > COI[1])
c2 = (MAC > MAC[1])
c3 = (STO > 20)
c4 = (STO < 40)
c5 = (STO > STO[1])
// Conditions to enter short positions
c11 = (COI< COI[1])
c12 = (MAC< MAC[1])
c13 = (STO < 80)
c14 = (STO > 60)
c15 = (STO < STO[1])
//first trade whatever condition
if NOT ONMARKET AND HIGHEST[5](c1)=1 AND HIGHEST[5](c2)=1 AND HIGHEST[5](c3)=1 AND HIGHEST[5](c4)=1 AND HIGHEST[5](c5)=1 then //close>close[1]
BUY amount LOT AT MARKET
endif
if NOT ONMARKET AND HIGHEST[5](c11)=1 AND HIGHEST[5](c12)=1 AND HIGHEST[5](c13)=1 AND HIGHEST[5](c14)=1 AND HIGHEST[5](c15)=1 then //close<close[1]
SELLSHORT amount LOT AT MARKET
endif
// case BUY - add orders on the same trend
if longonmarket and close-tradeprice(1)>=gridstep*pipsize then
BUY amount LOT AT MARKET
endif
// case SELL - add orders on the same trend
if shortonmarket and tradeprice(1)-close>=gridstep*pipsize then
SELLSHORT amount LOT AT MARKET
endif
//money management
liveaccountbalance = accountbalance+strategyprofit
moneyrisk = (liveaccountbalance*(riskpercent/100))
if onmarket then
onepointvaluebasket = pointvalue*countofposition
mindistancetoclose =(moneyrisk/onepointvaluebasket)*pipsize
endif
//floating profit
floatingprofit = (((close-positionprice)*pointvalue)*countofposition)/pipsize
//actual trade gains
MAfloatingprofit = average[20](floatingprofit)
BBfloatingprofit = MAfloatingprofit - std[20](MAfloatingprofit)*sd
//floating profit risk reward check
if rr>0 and floatingprofit>moneyrisk*rr then
RRreached=1
endif
//GRAPH floatingprofit as "float"
//GRAPH RRreached as "rr"
//GRAPH floatingprofit as "floating profit"
//GRAPH BBfloatingprofit as "BB Floating Profit"
//GRAPH positionprice-mindistancetoclose
//GRAPH moneyrisk
//GRAPH onepointvaluebasket
//GRAPH gridstep
//stoploss trigger when risk reward ratio is not met already
if onmarket and RRreached=0 then
SELL AT positionprice-mindistancetoclose STOP
EXITSHORT AT positionprice-mindistancetoclose STOP
endif
//stoploss trigger when risk reward ratio has been reached
if onmarket and RRreached=1 then
if floatingprofit crosses under BBfloatingprofit then
SELL AT MARKET
EXITSHORT AT MARKET
endif
endif
//resetting the risk reward reached variable
if not onmarket then
RRreached = 0
endif