Using GRAH and GRAPHONPRICE will help you locate any error:
graphonprice mS2M
graph tlmS2M
graph tsmS2M
as you can see from the attached pics, when your conditions are met trades are opened regularly, otherwise they are not.
So it’s your confitions that are not met.
Check if they are what you want.
In line 238 you use AND, so both conditions must be met, while sometimes only one of them is.
Find it why, thank you Roberto.
1 – The code uses the previous PP (1) so of course there were no trade taken in the mentioned levels today (0). Sorry 😉
2 – But when i change the PP with (0) instead of (1) it gives a funny PP… How can i have it straight like the PRT one please?
Thank you.
Damien
If you want the same pivot point as PRT, then use one of these codes below :
IF (DAYOFWEEK=DAYOFWEEK[1] and DAYOFWEEK<>DAYOFWEEK[2] and dayofweek>1) or (DAYOFWEEK<>DAYOFWEEK[1] and dayofweek=0) then
IF dayofweek <> 1 THEN
PivotPoint = (DHigh(1) + DLow(1) + DClose(1)) / 3
DH=DHigh(1)
DC = DClose(1)
ENDIF
If dayofweek=1 then
PivotPoint = (DHigh(2) + DLow(2) + DClose(2)) / 3
endif
endif
ONCE HH = high
ONCE LL = low
ONCE CC = close
IF (OpenTime = 010000 and dayofweek<>1) or (OpenTime = 000000 and dayofweek=0) THEN
yHH = HH
yLL = LL
yCC = CC
HH = high
LL = low
ENDIF
HH = max(HH,high)
LL = min(LL,low)
CC = close
Pivot = (yHH + yLL + yCC)/3