Ribbon

#1
Hello,
I'm trying to make a "Ribbon" in a compound of two indicdores AFL, the RSI and MACD. The "Ribbon" is drawn but not its color. The problem is probably related to the scale of both indicators. Someone can correct the AFL. Thank you very much.

regards,



_SECTION_BEGIN("RSI");
SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );
Plot( RSI( periods), _DEFAULT_NAME(), ParamColor( "Color", colorGreen ), ParamStyle("Style") );

//Plot(0, "", colorGreen, styleLine);
Plot(80, "", colorBlue, styleLine);

Plot(20, "", colorRed, styleLine);

Plot(60, "", colorGreen, styleDashed);

Plot(40, "", colorRed, styleDashed);




_SECTION_END();

_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")+styleOwnScale );

Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( ml = MACD(r1, r2), "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleOwnScale| styleNoLabel, maskHistogram ) );

Color88= IIf ( RSI(periods) > sl = Signal(r1,r2,r3), colorSkyblue, colorOrange);

Plot (1, "", Color88, styleArea+styleOwnScale, 0.5, 100);


_SECTION_END();
 
#2
Hello,
I'm trying to make a "Ribbon" in a compound of two indicdores AFL, the RSI and MACD. The "Ribbon" is drawn but not its color. The problem is probably related to the scale of both indicators. Someone can correct the AFL. Thank you very much.

regards,
no meaning when you put 2 indicator with different scale into 1 pane
 
#4
Hello,

Thanks for the reply.
Is there any way to match the "0" on the scale of the MACD with the "50" on the scale of RSI.

regards,
plus with 50 before you use plot command

:lol:


Plot( 50+ MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style")+styleOwnScale );

Plot( 50+ Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( 50+ MACD(r1, r2), "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleOwnScale| styleNoLabel, maskHistogram ) );
 
Last edited:

Similar threads