I want to place RSI and OBV on "transparent" layers.

bharatk8

Active Member
#1
Found this information in Amibroker help manual

...... Layers are like pieces of transparent plastic

If so Can I place OBV/RSI on this transparent layer?

I prefer to have RSI and OBV on same chart,but it seems it squeezes my chart view due to clash of scales.

So I want to place RSI and OBV on "transparent" layers.Pl. guide
 

KelvinHand

Well-Known Member
#2
Found this information in Amibroker help manual

...... Layers are like pieces of transparent plastic

If so Can I place OBV/RSI on this transparent layer?

I prefer to have RSI and OBV on same chart,but it seems it squeezes my chart view due to clash of scales.

So I want to place RSI and OBV on "transparent" layers.Pl. guide
Read thoroughly the guide, the layers are for you to choose your timeframe visualization, nothing to do with indicators.

Ami can create many tabs per window and what you need to do is create 2 charting with same setup except you arrange you RSI, OBv in different tabs named "RSI" and "OBV".

When you want to see RSI, you flip to "RSI" Tab and then OBV is needed flip to "OBV" will achieve your "transparent".
It like magic.

If you tired of flipping here and there then, Ami also allow you to create many windows. you can also create 2 windows of same timeframe side by side with same chart setting but different indicator, no need to flip.
 
Last edited:
#3
Hello

For auto-adjusting the scaling for different indicators needed to be displayed in same pane/window use styleOwnScale

Code:
_SECTION_BEGIN("OBV");
Plot( OBV(), _DEFAULT_NAME(), ParamColor("Color1", colorCycle ), styleOwnScale|ParamStyle("Style1")  );
_SECTION_END();

_SECTION_BEGIN("RSI");
SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );
Plot( RSI( periods), "", ParamColor( "Color2", colorCycle ), styleOwnScale|ParamStyle("Style2")  );
_SECTION_END();

Happy :)
 
#4
Hi Happy
Thanks for the code.
I feel this way-sorry cant put it exactly what it is.
but,we need to have this combination like an oscillator.
say keeping RSI steady,project OBV spikes more visibly.

may be keep RSI (OR Rsi =50 )as zero base and project obv spikes above and below it like.

KELVINHAND
sir,please give your guidance hints on this if this is worthwhile and oblige!
best regards to HAPPY And KELVINHAND
ford
 
#5
Hi Happy
Thanks for the code.
I feel this way-sorry cant put it exactly what it is.
but,we need to have this combination like an oscillator.
say keeping RSI steady,project OBV spikes more visibly.

may be keep RSI (OR Rsi =50 )as zero base and project obv spikes above and below it like.

KELVINHAND
sir,please give your guidance hints on this if this is worthwhile and oblige!
best regards to HAPPY And KELVINHAND
ford
Hello ford

Have you tried the above code? it plots both the obv & rsi clearly.

You may also try this . . . the scale of rsi will be fixed/default and OBV will be adjusted

Code:
periods = Param( "Periods", 15, 1, 200, 1 );
Plot(RSI( periods), "RSI",ParamColor("Color2",colorCycle),StyleThick);
Plot(OBV(),"OBV",ParamColor("Color1",colorCycle),styleOwnScale|StyleThick);
may be keep RSI (OR Rsi =50 )as zero base and project obv spikes above and below it like.
as did not exactly understand the above, can you try to say that again with more details


Happy
 

KelvinHand

Well-Known Member
#6
Hi Happy
Thanks for the code.
I feel this way-sorry cant put it exactly what it is.
but,we need to have this combination like an oscillator.
say keeping RSI steady,project OBV spikes more visibly.

may be keep RSI (OR Rsi =50 )as zero base and project obv spikes above and below it like.

KELVINHAND
sir,please give your guidance hints on this if this is worthwhile and oblige!
best regards to HAPPY And KELVINHAND
ford
How about 1 window for multiple indicators with switch:

Code:
_SECTION_BEGIN("Main");
Opt =ParamList("Indicators", "RSI|OBV|Macd");

_SECTION_END();

_SECTION_BEGIN("RSI");

SetChartOptions(0,0,chartGrid50|chartGrid30|chartGrid70);

Periods = Param( "Periods", 14, 1, 200, 1 );
Color=ParamColor( "Color", colorWhite );
Style=ParamStyle("Style", styleNoLabel);  


if (Opt=="RSI")
{
Plot( RSI( periods), _DEFAULT_NAME(), Color, Style);
}
_SECTION_END();

_SECTION_BEGIN("OBV");
SetChartOptions(0,0, chartGridMiddle);

Color=ParamColor( "Color", colorOrange );
Style=ParamStyle("Style", styleNoLabel);  


if (Opt=="OBV")
{
Plot( OBV(), _DEFAULT_NAME(), color, style);
}
_SECTION_END();

_SECTION_BEGIN("Macd");
SetChartOptions(0,0, chartGrid0);


iFast = Param("Fast Period", 12, 1);
iSlow = Param("Slow Period", 26, 1);
iSignal=Param("Signal Period", 9, 1);



MacdColor=ParamColor( "Macd Color", colorAqua);
MacdStyle=ParamStyle("Macd Style", styleNoLabel);  

SignalColor=ParamColor( "Signal Color", colorRed);
SignalStyle=ParamStyle("Signal Style", styleNoLabel);  


if (Opt=="Macd")
{
Plot( MACD(ifast, iSlow), "Macd", macdcolor, macdstyle);
Plot( Signal(ifast, iSlow, isignal), "Singal", signalcolor, signalstyle);

}
_SECTION_END();
 
Last edited:
#7
Hi Happy

thanks for asking.

first thing
Let me thank Bharatbhai to bring up this topic-unusual combination.
Thanks bharat for the idea!
What an idea sirjee!

let me begin.
have you seen a price oscillator code?
there they use ema9 and ema18 and gnerate th ocillator.
the oscillator basically keeps one of the ema as base and plots the diffrence above and below zero.
so,we get visibility,clarity,ease to apply readily.efficient visual comparison.
ok there they use same type of paramters a and b.

now coming to our case,two dissimilar parameters-we like to see in clarity how these two RSI and OBV are doing and comparing both.
here both indicators are strength based RSI IS PRICE STRENGTH, OBV is volume strength.
two high power independent parameters.
point is how to combine and see them in action.

hope I made myself clear. Be able to see both on same chart,be able to compare-say like relative strength or so.

best regards
ford
 
#8
Hi friends

I tried some slight additions on KELVINHAND,s code using switch between RSI & OBV. Looks good.still observing.

HTML:
_SECTION_BEGIN("Main");//code by kelvinhand


Opt =ParamList("Indicators", "RSI|OBV");

_SECTION_END();

_SECTION_BEGIN("RSI");

SetChartOptions(0,0,chartGrid50|chartGrid30|chartGrid70);

Periods = Param( "Periods", 14, 1, 200, 1 );
Color=ParamColor( "Color", colorWhite );
Style=ParamStyle("Style", styleNoLabel);  


if (Opt=="RSI")
{
Plot( RSI( periods), _DEFAULT_NAME(), Color, Style);
Plot(45,"45",colorRed,styleThick);
Plot(55,"55",colorBlue,styleThick);
}
_SECTION_END();

_SECTION_BEGIN("OBV");
SetChartOptions(0,0, chartGridMiddle);

Color=ParamColor( "Color", colorOrange );
Style=ParamStyle("Style", styleNoLabel);  


if (Opt=="OBV")
{
Plot( OBV(), _DEFAULT_NAME(), color, style);

Plot(MA(OBV(),21),"MAOBV-21",colorGreen,styleThick);

}
_SECTION_END();

uptre=OBV()>MA(OBV(),21);
downtre=OBV()<MA(OBV(),21);
Plot( 1.5, /* defines the height of the ribbon in percent of pane width */"ribbon",
IIf( uptre, colorGreen, IIf( downtre, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
regards
ford
 
#9
Hello

The OBV can have any range of numbers depending on accumulation of flow of volume in the entire historical DB we have, so numbers will be totally different for everybody.

Trying to get it to same base as that of RSI will also give us this effect i.e. different values depending upon number of bars in your DB.

Anyway here's the code, and as far as the indicator is concerned nothing special

Code:
_SECTION_BEGIN("RSI_OBV");
SetChartOptions(0,0,chartGrid30|chartGrid70);
P	=	Param( "Periods",15, 1, 200, 1);
HiOBV 		=	HHV(OBV(),P*10);
LoOBV 		= 	LLV(OBV(),P*10);
StochOBV 	= 	((OBV() - LoOBV)/(HiOBV - LoOBV))*100;	
R			=	RSI(P);
Plot(R,"RSI",colorDarkYellow,styleThick);
Plot(StochOBV ,"OBV",colorYellow,styleThick);
_SECTION_END();
Happy :)
 
#10
Hi Happy

Thanks for this code.

just see the below thing
it takes us to oscillator

it is not correct. some error may be there
the oscp(r1,r2) is not working here.
no idea why.

My idea is present rsi and obv as like price oscillator or like MACD
NOT OK YET
regards
ford
HTML:
SetChartOptions(0,0,chartGrid30|chartGrid70);
P	=	Param( "Periods",15, 1, 200, 1);
HiOBV 		=	HHV(OBV(),P*10);
LoOBV 		= 	LLV(OBV(),P*10);
StochOBV 	= 	((OBV() - LoOBV)/(HiOBV - LoOBV))*100;	
R			=	RSI(P);
//Plot(R,"RSI",colorBlue,styleThick);
//Plot(StochOBV ,"OBV",colorRed,styleThick);
_SECTION_END();
r1=StochOBV ;
r2 =RSI(P) ;
//r1=MA(StochOBV,10) ;
//r2 =MA(RSI(P),10) ;


RATIO = (r2-r1)/r2 ;
BARCOLOR =IIf(r1>r2,colorBrightGreen,colorRed);

Plot(RATIO,"RATIO",BARCOLOR,styleHistogram);
//Plot( OscP( r1,r2), _DEFAULT_NAME(), BARCOLOR, styleHistogram );//not ok
//Plot( abs(OscP( r1,r2)), _DEFAULT_NAME(), BARCOLOR, styleHistogram );//as per subroto
_SECTION_END();
 

Similar threads