Hello!
I’m trying to create a system based on atr calculated renko. I found an indicator in an old thread and tried to use that.
Defparam cumulateorders = false
positionsize = 1
boxsize = AverageTrueRange[14](close)
Period = 1000
boxsize = average[period]
once topprice = close
once bottomprice = close - boxsize
if(high > topprice + boxsize*2) THEN
topprice = close
bottomprice = topprice - boxsize*2
ELSIF (low < bottomprice - boxsize*2) THEN
bottomprice = close
topprice = bottomprice + boxsize*2
ELSE
topprice = topprice
bottomprice = bottomprice
ENDIF
If topprice + boxSize then
buy positionsize contracts at market
endif
If bottomprice - boxSize then
sellshort positionsize contracts at market
endif
It works for going long, but won’t sell short, and I can’t figure out why. Any ideas?
Thanks!
You appear to have 2 values for boxsize …
boxsize = AverageTrueRange[14](close)
Period = 1000
boxsize = average[period]
Silly me! Too much copy/paste.
It works now when using the ATR.