Stockholm
Experience: Intermediate
Platform: ProRealTime
Trading: DAX
Posts: 40 since Jul 2015
Thanks Given: 6
Thanks Received: 5
|
Hi!
I am trying to program a support- and resistance indicator for ProRealTime.
This is my criteria:
Support = a bar with lower low than the previous five bars and the next five bars.
Resistance = a bar with higher high than the previous last five bars and the next five bars.
The finished result should look much like Johns´s post here (second image):
This is the code I got so far: (the one for support)
______________________
IF (low[5]< low[0] AND low[5] < low[1] AND low[5] < low[2] AND low[5] < low[3] AND low[5] < low[4] AND low[5] < low[6] AND low[5] < low[7] AND low[5] < low[8] AND low[5] < low[9] AND low[5] < low[10]) THEN
Hogsta = low[5]
ENDIF
Return Hogsta
______________________
The problem is that the lines go from the "0-bar" - which means that they start "5 bars too late". So if I just could adjust them 5 bar in the x-direction.
Thanks in forward!
|