This automated trading strategy is built upon pseudo renko chart on ordinary candlesticks one.
Originally coded by request on French forums, this strategy use a combination of the renko on chart indicator available here : http://www.prorealcode.com/prorealtime-indicators/renko-boxes-on-price-chart/ and a moving average built within the close of each renko brick. The strategy consist of a simple cross over of the renko close and the moving average.
This code seems to work well on DAX on a 15 minutes timeframe. I know renko don’t deal with time, but my simple test shows that conditions which are tested only one time per bar are giving good results on this timeframe. I don’t have test much on any other instrument or other timeframe though. But it would certainly be profitable with any other ones as there are only 2 parameters to set : the brick size (20 points default size) and the moving average period (20 periods by default), which are quiet common and may not be so curve fitted..
Test were made with 1 point spread.
defparam cumulateorders = false
bsize = 20 //renko size in points
mmperiod = 20 //moving average period
orderstime = 300 //minimum seconds between 2 orders
boxsize = bsize*pipsize
once topprice = close
once bottomprice = close - boxsize*pipsize*2
if(close > topprice + boxsize*2) THEN
topprice = close
bottomprice = topprice - boxsize*2
barclose=topprice
ELSIF (close < bottomprice - boxsize*2) THEN
bottomprice = close
topprice = bottomprice + boxsize*2
barclose = bottomprice
ELSE
topprice = topprice
bottomprice = bottomprice
ENDIF
mm = average[mmperiod](barclose)
if barclose=barclose[1] then
mmRENKO = mmRENKO[1]
else
mmRENKO = mm
endif
if barclose crosses over mmRENKO AND ABS(time-lasttime)>orderstime then
BUY 1 SHARES AT MARKET
EXITSHORT AT MARKET
lasttime=time
endif
if barclose crosses under mmRENKO AND ABS(time-lasttime)>orderstime then
SELLSHORT 1 SHARES AT MARKET
SELL AT MARKET
lasttime=time
endif