- Joined
- 15 February 2012
- Posts
- 51
- Reactions
- 0
Play around with this a bit------from Ed's code. This provides you with a "flag" and the desired prices.
nbar = Param("nbar",5,2,50,1); // number of bars on each side
// define fractals
PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) <= H;
PHighPrice = ValueWhen(PHigh,H);
PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) >= L;
PLowPrice = ValueWhen(PLow,L);
nbar = Param("nbar",5,2,50,1); // number of bars on each side
// define fractals
PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) <= H;
PHighPrice = ValueWhen(PHigh,H);
PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) >= L;
PLowPrice = ValueWhen(PLow,L);