Code

#1
Buenas noches:

Necesito colorear el rea entre el MACD y su seal a modo de histograma. Alguien me puede ayudar con el cdigo. Gracias.

Saludos,


Good night:

I need to color the area between the MACD and their signal as a histogram. Somebody can help me with the code. Thanks.

Greetings,
 

karthikmarar

Well-Known Member
#2
_SECTION_BEGIN("MACD");
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", colorRed ), ParamStyle("MACD style") );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
PlotOHLC(ml,ml,sl,sl,"",colorLightYellow,styleCloud);

_SECTION_END();
 

pkgmtnl

Well-Known Member
#3
karthi ji
can u please help on this too,
for plotting a point

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

karthikmarar

Well-Known Member
#4
Hi Pkg

Here is the afl and a sample plot... maybe you have to refine your conditions a little and you can have nice system..




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

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

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

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

PlotShapes(IIf(Buy, shapeCircle, shapeNone),colorGreen, 0, ml, Offset=-10);
PlotShapes(IIf(Sell, shapeCircle, shapeNone),colorRed, 0, ml, Offset=10);
 
#5
Buenas noches,

Muchas gracias por la respuesta, pero no es exactamente lo que necesito. Yo quiero trazar un histograma entre ambas lineas, la del MACD y su seal.

Por cierto Karthikmarar, te importara pasarme el cdigo de " Swing Sistem"

Saludos,

Good night,

Thank you very much by the answer, but it is not exactly what I need. I want to draw up a histogram between both lines, the one of the MACD and their signal.

By the way Karthikmarar, would matter to you to pass the code to me of Swing Sistem. Thanks

Greetings,
 

karthikmarar

Well-Known Member
#7
By the way Karthikmarar, would matter to you to pass the code to me of Swing Sistem. Thanks

Greetings,
The Swing system (called the NMA swing system) is a open system.... Can be downloaded from my personal website www(dot)tatechnics(dot)in

(Mods , please note , delete this post if it is against forum rules )
 
#9
Buenas noches:

Muchas gracias por la informacin, Karthik Marar

Saludos


Good night:

Thank you very much by the information, Karthik Marar

Greetings
 
#10
Buenas tardes, Karthik Marar:

Finalmente tengo el MACD como lo necesito, gracias a Usted.
Sera posible, en lugar de tener el espacio entre ambas lineas de un solo color, tenerlo como si fuera un histograma. Muchas gracias.
Por cierto he comenzado a estudiar el sistema "NMA Swing system" y creo que es muy prometedor, en cuanto lo analice a fondo le enviar mis comentarios. Gracias.

Saludos,


Good afternoon, Karthik Marar:

Finally I have the MACD I need as it, thanks to You.
It would be possible, instead of to have the space between both lines of a single color, to have it as if outside a histogram. Thank you very much.
By the way I have begun to study system NMA Swing system and believe that he is very promising, it analyzes as soon as it thoroughly I will send my commentaries to him. Thanks.

Greetings,
 

Similar threads