Draw a horizontal line of a particular date

how to daw a horizontal line taking a close of a particular day.
date i will enter in paramter box whixh is dynamic.?

You’ll need version 6.20 for this to work. Otherwise you can use one of the other formats listed at:
https://www.amibroker.com/guide/afl/paramdate.html

DateParam = ParamDate("Price at Date", "2017-06-30", 2);
PriceAtDate = Lookup(C, DateParam);

SetChartOptions(0,chartShowArrows|chartShowDates);
Plot(C, "Price", colorBlack, styleCandle);
Plot(PriceAtDate, "Horizontal Line", colorRed);
1 Like

thank u so much for your help. i could manage it on 6.1 . just i need to select the date one day before i want,
DateParam = ParamDate(“Price at Date”, “2017-06-30”,1);
dateparam=StrToDateTime(dateparam); // had to write to make it compatible with lookup
PriceAtDate = Lookup(o,DateParam,2);

Plot(PriceAtDate, “HL”, colorRed,styleLine|styleNoRescale);

1 Like