Hi all,
I just created a simple afl to show gaps on the chart.
You can chose in percentage the minimum gapdifference.
_SECTION_BEGIN("_plot gap");
Difference=Param("difference",0,0,5,0.1);
Diff=((Ref(C,-1)/100)*Difference);
GapU=O>Ref(H,-1)+Diff;
GapUL=(O>Ref(H,-1)+Diff) AND L<=Ref(L,-1);
GapUC=(O>Ref(H,-1)+Diff) AND L<=Ref(C,-1);
GAPUH=(O>Ref(H,-1)+Diff) AND L<=Ref(H,-1);
GAPUM=(O>Ref(H,-1)+Diff) AND (L<=((Ref(H,-1)+Ref(L,-1))/2));
GapD=O<Ref(L,-1)-Diff;
GapDL=(O<Ref(L,-1)-Diff) AND H>=Ref(L,-1);
GapDC=(O<Ref(L,-1)-Diff) AND H>=Ref(C,-1);
GAPDH=(O<Ref(L,-1)-Diff) AND H>=Ref(H,-1);
GAPDM=(O<Ref(L,-1)-Diff) AND (H>=((Ref(H,-1)+Ref(L,-1))/2));
Gap_U= ParamToggle("gap up ","No|Yes",0);
Gap_UH= ParamToggle("gap up narrowed to previous high ","No|Yes",0);
Gap_UC= ParamToggle("gap up narrowed to previous close ","No|Yes",0);
Gap_UL= ParamToggle("gap up narrowed to previous low ","No|Yes",0);
Gap_UM= ParamToggle("gap up narrowed to previous middle ","No|Yes",0);
Gap_D= ParamToggle("gap down ","No|Yes",0);
Gap_DL= ParamToggle("gap down narrowed to previous low ","No|Yes",0);
Gap_DC= ParamToggle("gap down narrowed to previous close ","No|Yes",0);
Gap_DH= ParamToggle("gap down narrowed to previous high ","No|Yes",0);
Gap_DM= ParamToggle("gap down narrowed to previous middle ","No|Yes",0);
if (Gap_U)
PlotShapes(GapU*shapeSmallCircle,colorBlue);
if (Gap_UL)
PlotShapes(GapUL*shapeSmallCircle,colorBlue);
if (Gap_UC)
PlotShapes(GapUC*shapeSmallCircle,colorBlue);
if (Gap_UH)
PlotShapes(GapUH*shapeSmallCircle,colorBlue);
if (Gap_UM)
PlotShapes(GapUM*shapeSmallCircle,colorBlue);
if (Gap_D)
PlotShapes(GapD*shapeSmallCircle,colorOrange);
if (Gap_DL)
PlotShapes(GapDL*shapeSmallCircle,colorOrange);
if (Gap_DC)
PlotShapes(GapDC*shapeSmallCircle,colorOrange);
if (Gap_DH)
PlotShapes(GapDH*shapeSmallCircle,colorOrange);
if (Gap_DM)
PlotShapes(GapDM*shapeSmallCircle,colorOrange);
_SECTION_END();
What need improvement is still the visual aspect. I.e. if you selected "yes" in all the gap ups, that you get 5 dots vertical below the low, each a different color.
I'am still a bit struggeling with that.
Also im not sure I calculated the gap percentage the right way. Please correct me if im wrong.
I just created a simple afl to show gaps on the chart.
You can chose in percentage the minimum gapdifference.
_SECTION_BEGIN("_plot gap");
Difference=Param("difference",0,0,5,0.1);
Diff=((Ref(C,-1)/100)*Difference);
GapU=O>Ref(H,-1)+Diff;
GapUL=(O>Ref(H,-1)+Diff) AND L<=Ref(L,-1);
GapUC=(O>Ref(H,-1)+Diff) AND L<=Ref(C,-1);
GAPUH=(O>Ref(H,-1)+Diff) AND L<=Ref(H,-1);
GAPUM=(O>Ref(H,-1)+Diff) AND (L<=((Ref(H,-1)+Ref(L,-1))/2));
GapD=O<Ref(L,-1)-Diff;
GapDL=(O<Ref(L,-1)-Diff) AND H>=Ref(L,-1);
GapDC=(O<Ref(L,-1)-Diff) AND H>=Ref(C,-1);
GAPDH=(O<Ref(L,-1)-Diff) AND H>=Ref(H,-1);
GAPDM=(O<Ref(L,-1)-Diff) AND (H>=((Ref(H,-1)+Ref(L,-1))/2));
Gap_U= ParamToggle("gap up ","No|Yes",0);
Gap_UH= ParamToggle("gap up narrowed to previous high ","No|Yes",0);
Gap_UC= ParamToggle("gap up narrowed to previous close ","No|Yes",0);
Gap_UL= ParamToggle("gap up narrowed to previous low ","No|Yes",0);
Gap_UM= ParamToggle("gap up narrowed to previous middle ","No|Yes",0);
Gap_D= ParamToggle("gap down ","No|Yes",0);
Gap_DL= ParamToggle("gap down narrowed to previous low ","No|Yes",0);
Gap_DC= ParamToggle("gap down narrowed to previous close ","No|Yes",0);
Gap_DH= ParamToggle("gap down narrowed to previous high ","No|Yes",0);
Gap_DM= ParamToggle("gap down narrowed to previous middle ","No|Yes",0);
if (Gap_U)
PlotShapes(GapU*shapeSmallCircle,colorBlue);
if (Gap_UL)
PlotShapes(GapUL*shapeSmallCircle,colorBlue);
if (Gap_UC)
PlotShapes(GapUC*shapeSmallCircle,colorBlue);
if (Gap_UH)
PlotShapes(GapUH*shapeSmallCircle,colorBlue);
if (Gap_UM)
PlotShapes(GapUM*shapeSmallCircle,colorBlue);
if (Gap_D)
PlotShapes(GapD*shapeSmallCircle,colorOrange);
if (Gap_DL)
PlotShapes(GapDL*shapeSmallCircle,colorOrange);
if (Gap_DC)
PlotShapes(GapDC*shapeSmallCircle,colorOrange);
if (Gap_DH)
PlotShapes(GapDH*shapeSmallCircle,colorOrange);
if (Gap_DM)
PlotShapes(GapDM*shapeSmallCircle,colorOrange);
_SECTION_END();
What need improvement is still the visual aspect. I.e. if you selected "yes" in all the gap ups, that you get 5 dots vertical below the low, each a different color.
I'am still a bit struggeling with that.
Also im not sure I calculated the gap percentage the right way. Please correct me if im wrong.