Hey Friends,
I have to plot Horizontal line for HIGH on Particular Day, for example, I have to plot horizontal line for OCT 21 2018.s Days HIGH,
I have tried different ways but not getting the results, below is the example
Plot (LastValue(TimeFrameGetPrice("High", inDaily, -45)), "Prev H", colorGreen);
For the above code, I need to increase days (-445 to 446.....) each day, so I am requesting you please provide me the solution for constant.
Thanks you.
fxshrat
#2
Use ValueWhen or LookUp.
dtstr = "2018-10-21 00:00:00";
dt = DateTime();
hh_day = TimeFrameGetPrice("High", inDaily, 0);
hh_dt = ValueWhen(dt == _DT(dtstr), hh_day);
Plot(hh_dt, "Prev H", colorGreen);
Plot( C, "Price", colorDefault, styleBar );
dtstr = "2018-10-21 00:00:00";
hh_day = TimeFrameGetPrice("High", inDaily, 0);
hh_dt = Lookup(hh_day, _DT(dtstr));
Plot(hh_dt, "Prev H", colorGreen);
Plot( C, "Price", colorDefault, styleBar );
7 Likes