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 ) );
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: