Hello to everybody, I have a question.
According to the following conditions of swing points and the chart attached:
SPH=high[2]<high[1] and high[0]<=high[1] // (swing point high)
SPL= low[2]>low[1] and low[0]>=low[1] // (swing point low)
how can i recall for example SPH1 or SPL2 to set proscreener or probuilder indicator conditions?
For example, I want to screen for the conditions: SPH1 >SPH2 and SPL1<SPL2 …….etc…
Thanks in advance for your help
Max
To write code, please use the <> “insert PRT code” button, to make code easier to read.
Thank you.
You have to use a different variable for any swing point you want to recall.
Since PRT does not support arrays you cannot access those data dynamically.
if high[2]<high[1] and high[0]<=high[1] then
sph3 = sph2
sph2 = sph1
sph1 = high[1]
endif
if low[2]>low[1] and low[0]>=low[1]
spl3 = spl2
spl2 = spl1
spl1 = low[1]
endif
Maybe the above is something like what you want and what Roberto means by needing a different variable for each swing point? You will need to check that sph1, sph2, sph3, spl1,spl2 and spl3 etc have a different value than zero before you use them in a condition.