- Joined
- 30 June 2007
- Posts
- 7,200
- Reactions
- 1,225
Ahoy Cap'n.
Like so:
////E.M.Pottasch 09/06/10
SetBarsRequired(sbrAll,sbrAll);
nbar = 5;//Param("nbar",2,2,50,1);
PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) < H;
PHighPrice0 = ValueWhen(PHigh,H);
PHighPrice1 = IIf(PHighPrice0 AND BarsSince(PHigh) > nbar,PHighPrice0,Null); PHighPrice2 = IIf(PHighPrice0 AND BarsSince(PHigh) <= nbar,PHighPrice0,Null);
PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) > L;
PLowPrice0 = ValueWhen(PLow,L);
PLowPrice1 = IIf(PLowPrice0 AND BarsSince(Plow) > nbar,PLowPrice0,Null); PLowPrice2 = IIf(PLowPrice0 AND BarsSince(Plow) <= nbar,PLowPrice0,Null);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(C,"\nLast",colorWhite,styleCandle);
PlotShapes(shapeSmallCircle*PLow,colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*PHigh,colorYellow,0,H,10);
PlotShapes(shapeUpArrow*PLow,colorGreen,0,L,-25);
PlotShapes(shapeDownArrow*PHigh,colorRed,0,H,-25);
Plot(PHighPrice1,"\nPHighPrice",colorYellow,styleThick);
Plot(PHighPrice2,"",colorYellow,styleDots | styleNoLine);
Plot(PLowPrice1,"\nPLowPrice",colorDarkGreen,style
------------------------------------------------------
I tried ValueWhen(PLowPrice1,L,1)>ValueWhen(PLowPrice1,L,2)
No luck however. Any suggestions please?
Like so:
////E.M.Pottasch 09/06/10
SetBarsRequired(sbrAll,sbrAll);
nbar = 5;//Param("nbar",2,2,50,1);
PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) < H;
PHighPrice0 = ValueWhen(PHigh,H);
PHighPrice1 = IIf(PHighPrice0 AND BarsSince(PHigh) > nbar,PHighPrice0,Null); PHighPrice2 = IIf(PHighPrice0 AND BarsSince(PHigh) <= nbar,PHighPrice0,Null);
PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) > L;
PLowPrice0 = ValueWhen(PLow,L);
PLowPrice1 = IIf(PLowPrice0 AND BarsSince(Plow) > nbar,PLowPrice0,Null); PLowPrice2 = IIf(PLowPrice0 AND BarsSince(Plow) <= nbar,PLowPrice0,Null);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(C,"\nLast",colorWhite,styleCandle);
PlotShapes(shapeSmallCircle*PLow,colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*PHigh,colorYellow,0,H,10);
PlotShapes(shapeUpArrow*PLow,colorGreen,0,L,-25);
PlotShapes(shapeDownArrow*PHigh,colorRed,0,H,-25);
Plot(PHighPrice1,"\nPHighPrice",colorYellow,styleThick);
Plot(PHighPrice2,"",colorYellow,styleDots | styleNoLine);
Plot(PLowPrice1,"\nPLowPrice",colorDarkGreen,style
------------------------------------------------------
I tried ValueWhen(PLowPrice1,L,1)>ValueWhen(PLowPrice1,L,2)
No luck however. Any suggestions please?