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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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!