ksr
September 9, 2019, 5:43pm
1
Dear Folks,
I am trying to plot only current days data, all i could code is the following
ToDate = ParamDate( "Choose Date", "2019-09-09" ); Cond = IIf(DateNum() == ToDate , Close,Null ); Plot(Cond, "Price", colorBlack);
But the above only Plots the closing price,
i am looking for a candle/bar chart instead of just closing price line chart.
Need your kind assistance.
Thanks.
You we're pretty close. Missing one more part in your Plot() condition.
ToDate = ParamDate( "Choose Date", "2019-09-09" );
Cond = IIf(DateNum() == ToDate , Close,Null );
Plot(Cond, "Price", colorBlack,styleCandle);
Also if you wanted to not have to update the ParamDate() everyday, I believe the Now() function should work. Don't have a intraday data plugin to try but tried with before/after updating my EOD database.
Today = Now(3);
Cond = IIf(DateNum() == Today , Close,Null );
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( cond, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
4 Likes
ksr
September 10, 2019, 3:02am
3
Dear Metamega,
Thanks a lot for your help,
Your code has worked.
Thanks a Bunch again.