Skip to main content

All Time High Exploration for Amibroker (AFL)

husni over 15 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 2)
  • Tags:
    amibroker, exploration

Explore to inform : Highest Price, Close Price, Difference Value, Percent Difference , time duration

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("All Time Hi Explorer");
ATH = IIf( H > Ref(Highest(H),-1), H , Ref(Highest(H),-1));
Diff = IIf( ATH > C , C - ATH , 0 );
PctDiff = IIf( ATH > C , ( Diff / ATH )*100 , 0 );

Plot(Diff , "Diff" , colorDefault , stylehidden);
Plot(PctDiff , "% Diff" , colorDefault , stylehidden);
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
Plot( Volume,"Volume",colorBlack,styleHidden);
//Coded by Christopher Tahir, Idea by Ben//
Chg = C - Ref(C,-1);
Title = "  •  " + Name() + "  •  ||  " + Interval(2) + "  ||  •  " + Date() + "  •  Open " + Open + "  •  Hi " + H + "  •  Lo " + L + "  •  Close " + Close + " (" + WriteVal(Chg,1.2) + " pts  " + WriteVal(ROC(C,1),1.2) + "%)  •  Vol "+WriteVal(V,1.0)
+ EncodeColor(colorBlue) + "\n\n  •  Differences from All Time High = " + WriteVal(Diff,1.2) + " pts (" + WriteVal(PctDiff , 1.2) + "%)";;

Filter = ATH OR C < ATH;
SetOption("NoDefaultColumns", True );
AddTextColumn(Name(),"Ticker",1.0,colorDefault,colorDefault,60);
AddColumn( DateTime(), "Date", formatDateTime,colorDefault,colorDefault,68 );
AddColumn(ATH , "All Time High" , 1.0 , colorDefault , IIf( PctDiff > 66 , colorRed , IIf( PctDiff > 0 AND PctDiff < 33 , colorBrightGreen , colorYellow )) , 68 );
AddColumn(C , "Close ", colorDefault, colorWhite,60 );
AddColumn(-Diff , "Difference from All Time High" , 1.2 , colorDefault , IIf( PctDiff > 66 , colorRed , IIf( PctDiff > 0 AND PctDiff < 33 , colorBrightGreen , colorYellow )) , 68 );
AddColumn(-PctDiff , "%" , 1.2 , colorDefault , IIf( PctDiff > 66 , colorRed , IIf( PctDiff > 0 AND PctDiff < 33 , colorBrightGreen , colorYellow )) , 68 );
_SECTION_END();

4 comments

1. Tunan
almost 12 years ago

Hello
Thanks for this upload…

Pls Can u modified this AFL into “All Time High-Low Exploration” or “All Time Low Exploration”

I’ll b grateful to u…

Thank You in Advance…

2. emf912
almost 9 years ago

Thank you for this. But in my market, there are alot of penny stocks. How to add decimals? Thanks again!

Leave Comment

Please login here to leave a comment.