General Trading Chat

vijkris

Learner and Follower
Box 2timeframe.

Code:
_SECTION_BEGIN("Box Afl 2TF");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorYellow), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
x=Param("Timeframe",5,1,1440,1);
TimeFrameSet(x*in1Minute);
box=(Ref(C,0)>=Ref(O,-3) AND Ref(C,0)<=Ref(C,-3) AND Ref(C,-1)>=Ref(O,-3) AND Ref(C,-1)<=Ref(C,-3) AND Ref(C,-2)>=Ref(O,-3) AND Ref(C,-2)<=Ref(C,-3)) OR (Ref(C,0)<=Ref(O,-3) AND Ref(C,0)>=Ref(C,-3) AND Ref(C,-1)<=Ref(O,-3) AND Ref(C,-1)>=Ref(C,-3) AND Ref(C,-2)<=Ref(O,-3) AND Ref(C,-2)>=Ref(C,-3));
e1=ValueWhen(box,Ref(C,-3));
e2=ValueWhen(box,Ref(O,-3));
e3=MA( C, 21 );
TimeFrameRestore();

e1=TimeFrameExpand(e1,x*in1Minute,expandLast);
e2=TimeFrameExpand(e2,x*in1Minute,expandLast);
e3=TimeFrameExpand(e3,x*in1Minute,expandLast);
e3=MA(e3,10);
PlotOHLC(e1,e1,e2,e2,"",IIf(e1>e2,colorPaleGreen,colorLightOrange),styleCloud | styleNoLabel,0,0,0,-2);
Plot(e1,"",colorBlack,styleLine,0,0,0,0);
Plot(e2,"",colorBlack,styleLine,0,0,0,0);
Plot( e3, "",IIf(e3>Ref(e3,-1),colorGreen,IIf(e3<Ref(e3,-1),colorOrange,colorYellow)),styleThick ); 


_SECTION_END();
thanks for afl
so, if price inside box means is it sideways?
 

333

Active Member
Box 2timeframe.

Code:
_SECTION_BEGIN("Box Afl 2TF");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorYellow), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
x=Param("Timeframe",5,1,1440,1);
TimeFrameSet(x*in1Minute);
box=(Ref(C,0)>=Ref(O,-3) AND Ref(C,0)<=Ref(C,-3) AND Ref(C,-1)>=Ref(O,-3) AND Ref(C,-1)<=Ref(C,-3) AND Ref(C,-2)>=Ref(O,-3) AND Ref(C,-2)<=Ref(C,-3)) OR (Ref(C,0)<=Ref(O,-3) AND Ref(C,0)>=Ref(C,-3) AND Ref(C,-1)<=Ref(O,-3) AND Ref(C,-1)>=Ref(C,-3) AND Ref(C,-2)<=Ref(O,-3) AND Ref(C,-2)>=Ref(C,-3));
e1=ValueWhen(box,Ref(C,-3));
e2=ValueWhen(box,Ref(O,-3));
e3=MA( C, 21 );
TimeFrameRestore();

e1=TimeFrameExpand(e1,x*in1Minute,expandLast);
e2=TimeFrameExpand(e2,x*in1Minute,expandLast);
e3=TimeFrameExpand(e3,x*in1Minute,expandLast);
e3=MA(e3,10);
PlotOHLC(e1,e1,e2,e2,"",IIf(e1>e2,colorPaleGreen,colorLightOrange),styleCloud | styleNoLabel,0,0,0,-2);
Plot(e1,"",colorBlack,styleLine,0,0,0,0);
Plot(e2,"",colorBlack,styleLine,0,0,0,0);
Plot( e3, "",IIf(e3>Ref(e3,-1),colorGreen,IIf(e3<Ref(e3,-1),colorOrange,colorYellow)),styleThick ); 


_SECTION_END();
thanks for afl
so, if price inside box means is it sideways?
yea box shows sideways or flat structure.Take trades away from the box.
 

Similar threads