Rescale graph, average and indicator

Hi, I don't know why the chart doesn't display well and I can't get each indicator to scale properly. Can you help me?. I send the code. Price, WMA and RSC Mansfield. Do not scold me that I have read the manual but I can not fix it. Greetings

_SECTION_BEGIN("Price");

_N(Title = StrFormat("{{FULLNAME}} ------  {{INTERVAL}} {{DATE}}     ******Open %g----- Hi %g, Lo %g-----Close %g (%.1f%%) {{VALUES}}*****", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("", colorGreen ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN ("WMA"); 
r1 = ParamColor ("Color alcista", colorBlue ); 
r2 = ParamColor ("Color bajista", colorRed ); 
r3 = ParamStyle ("Style", styleLine + styleThick + styleNoLabel); 
P = ParamField ("Price field",-1); 
Periods = Param ("Periods", 30, 2, 300, 1, 10 ); 
Plot( WMA( P, Periods ), _DEFAULT_NAME(), IIf ( WMA( P, Periods )>= Ref( MA( P, Periods ), -1), r1, r2), r3 );  
_SECTION_END();


_SECTION_BEGIN("RSC MANSFIELD SEMANAL VS. W1DOW ");

//![Captura|690x448](upload://126oT4ibrqgn3FjTyrit5dSyQQH.jpeg)
Uso en un timeframe semanal 52 semanas  Foro Aguila Roja - Suomi 

maPeriod = Param( "Periodo", 52, 0, 500, 1 );
rsSymbol = ParamStr( "Índice base", "W1DOW" );
// calculamos "standard relative performance index".
rs = ( Close / Foreign( rsSymbol,"Close" ) );
// calculamos "Mansfield relative Performance indicador". El factor
// 10 es un valor arbitrario seleccionado por Mr. Mansfield
RscMansfield = 10*(( rs / MA( rs, maPeriod ) ) - 1);
Plot( RscMansfield,"RscMansfield  52 semanas",ParamColor( "Color", colorBlue ),1);
PlotOHLC(RscMansfield,RscMansfield,0,RscMansfield,"",
   IIf( RscMansfield > 0, ParamColor("Up Color", colorGreen ), ParamColor("Down Color", colorRed ) ),
   styleCloud);
_SECTION_END();


Captura

You need to use SEPARATE panes if you want to display so different ranges of indicator values. Alternatively you could use styleOwnScale or styleLeftAxisScale but it is recommended to just use separate pane for RSC. (Just copy-paste RSC part to second formula and Insert).

2 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.