Req:- Ploting Help

pkgmtnl

Well-Known Member
#1
BUY

Cond1 = MACD(r1,r2)>Ref(MACD(r1,r2),-1);

SELL

Cond2 = Ref(MACD(r1,r2),-1)>MACD(r1,r2);

I want to plot a Dot just above or below when this condition first comes in chart ,

kindly guide me to write syntax to plot this point.

on the below AFL

r1 = Param( "Fast avg", 15, 2, 200, 1 );
r2 = Param( "Slow avg", 30, 2, 200, 1 );
r3 = Param( "Signal avg", 15, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorBlack ), 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 ) );
 
Last edited:
#2
pkgmtnl,

I think the following AFL will do the job.

_SECTION_BEGIN("Price");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorDarkGrey));
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);
GraphXSpace = 5;
Plot(C,"",colorWhite,styleCandle);
_SECTION_END();

_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 15, 2, 200, 1 );
r2 = Param( "Slow avg", 30, 2, 200, 1 );
r3 = Param( "Signal avg", 15, 2, 200, 1 );
x = MACD(r1,r2)>Ref(MACD(r1,r2),-1);
y = MACD(r1,r2)<Ref(MACD(r1,r2),-1);
Buy = Cover = Cross(x,y);
Sell = Short = Cross(y,x);
PlotShapes(IIf(Buy,shapeSmallCircle,shapeNone),colorBrightGreen,0,L,-15);
PlotShapes(IIf(Sell,shapeSmallCircle,shapeNone),colorRed,0,H,15);
_SECTION_END();


Vidyasagar
 
#3
pkgmtnl,

please remove spaces after

PlotShapes(IIf(Buy,shapeSmallCircle,shapeNone),col
PlotShapes(IIf(Sell,shapeSmallCircle,shapeNone),co

Vidyasagar
 

Similar threads