Hello deepak ,
check this
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g,
Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C,
SelectedValue( ROC( C, 1 )) ));
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2),
ParamColor("MACD color", colorBlue ), ParamStyle("MACD style") );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal
color", colorRed ), ParamStyle("Signal style") );
Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ),
styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel,
maskHistogram ) );
Col=IIf(ml>sl,5,4);
Plot( C, "Close", Col, 64 | styleOwnScale );
candle is green when macd is above the signal line , and red when macd is below
its signal line.
thank you
*hope this is what you needed
--- In [email protected], Deepak Patade <deepakpat...@...> wrote:
>
> Can you helpme in this
> Plot the color of candle green if MACD is above signal line
> and
> Plot the candle red when signal line is above green line.
>
> Price
> ("Price");SetChartOptions(0,chartShowArrows|chartShowDates);_N(Title =
> StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g
> (%.1f%%) Vol "+WriteVal( V, 1.0) +" {{VALUES}}", O, H, L, C, SelectedValue(
> ROC( C, 1)) ));Plot( C, "Close", ParamColor("Color", colorBlack ),
> styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); if
> {
> ToolTip=
> }( ParamToggle("Tooltip shows", "All Values|Only Prices") )StrFormat("Open:
> %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1), O, H,
> L, C, SelectedValue( ROC( C, 1)));
>
>
> macd
> r1 = Param( "Fast avg", 12, 2, 200, 1);Param( "Slow avg", 26, 2, 200,
> 1);Param( "Signal avg", 9, 2, 200, 1);Plot( ml = MACD(r1, r2),
> StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color",
> colorBlue ), ParamStyle("MACD style") );Plot( sl = Signal(r1,r2,r3),
> "Signal"+ _PARAM_VALUES(), ParamColor("Signal color", colorRed ),
> ParamStyle("Signal style") );Plot( ml-sl, "MACD Histogram",
> ParamColor("Histogram color", colorBlack ), styleNoTitle |
> ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram )
> );
> r2 =
> r3 =
> Deepak Patade,
> Nasik.
>