I am trying to use this code but it only seems to register the factals in the CP periods. e.g If a buy signal is formed, it seems to only look at the high factals within the 20(cp) periods. If there is no high factal within that period it dosent look at the last ‘high’ factal.
I hope I am making sense.
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
cp=20
ifhigh[cp]>=highest[2*cp+1](close)then
LH=1
else
LH=0
endif
iflow[cp]<=lowest[2*cp+1](close)then
LL=-1
else
LL=0
endif
ifLH=1then
TOPy=high[cp]
TOPx=barindex[cp]
endif
ifLL=-1then
BOTy=low[cp]
BOTx=barindex[cp]
endif
timeframe(default)
//////////////////////
C1=(closeCROSSES OVERTOPy)
D1=(closeCROSSES UNDERBOTy)
How do I make it so that close crosses over the last TOPy not just the last TOPy within the 20 periods?
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue