two range axis one chart

#1
hi ,

i'm trying to plot a chart that consists of closing price ema and the diff between them it works fine but obviously it's useless because i can't realy see the diff it's very low and allmost looks like a straight line , is there a way to have two range axis in one chart ?
thanks .
attached is the afl :

_SECTION_BEGIN("MAIN");
Plot(Close,"Close",colorBlack,styleLine );

P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );

diff = Close - EMA (Close,Periods) ;
Plot(diff,"",colorYellow,styleLine );
_SECTION_END();
 
#2
hi ,

i'm trying to plot a chart that consists of closing price ema and the diff between them it works fine but obviously it's useless because i can't realy see the diff it's very low and allmost looks like a straight line , is there a way to have two range axis in one chart ?
thanks .
attached is the afl :
Hi,

Plot the 'diff', ie C - EMA, on its own scale. So that it takes its own axis. Just add styleOwnScale while plotting the 'diff'.

Below is the updated code:
_SECTION_BEGIN("MAIN");
Plot(Close,"Close",colorBlack,styleLine );

P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 200, 1 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );

diff = Close - EMA (Close,Periods) ;
Plot(diff,"",colorYellow,styleLine | styleOwnScale );
_SECTION_END();
Also I've attached the screenshot of what it looks like. Let us know if you are looking for something else.

Praveen.
 

Attachments

#3
thnaks it works ,
it plots the diff now god but the left axis does not display the range of it , is there a way to do it ? i tried styleleftaxis but no change
and is there a book explaining alf with code examples ?
 
#4
thnaks it works ,
it plots the diff now god but the left axis does not display the range of it , is there a way to do it ? i tried styleleftaxis but no change
...
I tried here. But I couldn't find any solution. It will show the diff value at the right axis. May be others can help.

and is there a book explaining alf with code examples ?
My oft repeated answer : Amibroker User Guide. Best book for AFL.

Praveen.
 

Similar threads