pb=Optimize("period",2,2,50,1);
ps=Optimize("SwingPeriod",4,2,50,1);
A=HHV(High,pb);
B=LLV(Low,pb);
Buy=A > Ref( A,-ps)
AND B > Ref( B,-ps)
AND Close>A;
Sell=B < Ref( B,-ps);
It does not show results because of this one
Close>A
Close can not be larger than HHV of current bar. HHV includes current bar.
You have to change to e.g.
Close>Ref(A, -1)
6 Likes
Thankyou