[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Is it possible to divide an indicator pane into several zones?


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: Is it possible to divide an indicator pane into several zones?
  • From: "Anthony Faragasso" <ajf1111@xxxxxxxx>
  • Date: Tue, 17 Nov 2009 15:50:31 -0500

PureBytes Links

Trading Reference Links



Hello,
 
Formula returns Subscript out of range error..
 
 
----- Original Message -----
From: Bisto
Sent: Tuesday, November 17, 2009 1:53 PM
Subject: [amibroker] Re: Is it possible to divide an indicator pane into several zones?

 

Hi Paul,

in your case is definitely better to do as already suggest by the other guys but, according to me, sometimes it could be useful to divide one pane in two or more zones. the reason could be:

1) to share variables without using Static variables (to keep AFL more simple)

2) to have zones syncronized in a very fluid way (panes that share static variables are, at the best, syncronized every 1s setting RequestTimedRefresh( 1 ); )

I usually do it using the following functions to calculate min and max value to be used in plot with styleownscale

I hope it could help

bye

Bisto

function MinZone( array, PercZoneLow, PercZoneHigh )
{
fvb = Status( "firstvisiblebar" );
lvb = Status( "lastvisiblebar" );
HHVMax = -100000000;
LLVMin = 100000000;

for ( i = fvb; i <= Lvb; i++ )
{
HHVMax = Max( array[ i ], HHVMax );
LLVMin = Min( array[ i ], LLVMin );
}

MinZ = ( PercZoneLow * HHVMax - PercZoneHigh * LLVMin ) / ( PercZoneLow - PercZoneHigh );

return MinZ ;
}

function MaxZone( array, PercZoneLow, PercZoneHigh )
{
fvb = Status( "firstvisiblebar" );
lvb = Status( "lastvisiblebar" );
HHVMax = -100000000;
LLVMin = 100000000;

for ( i = fvb; i <= Lvb; i++ )
{
HHVMax = Max( array[ i ], HHVMax );
LLVMin = Min( array[ i ], LLVMin );
}

MinZ = ( PercZoneLow * HHVMax - PercZoneHigh * LLVMin ) / ( PercZoneLow - PercZoneHigh );

MaxZ = ( LLVMin - MinZ ) / PercZoneLow + MinZ;

return MaxZ ;
}

// example: use the above functions to define min and max values of styleownscale

// please note that axes type has to be linear (logartimic type requests little modification in the code)
// please also note that plot style has to be ALSO styleOwnScale

PercZoneLow1 = Param("PercZoneLow1",0.3,0.000001,1,0.05) ;
PercZoneHigh1 = Param("PercZoneHigh1 ",1,0.000001,1,0.05) ;

Plot( C, "C in zone", colorBlack, styleCandle | styleOwnScale, MinZone(C,PercZoneLow1,PercZoneHigh1), MaxZone(C,PercZoneLow1,PercZoneHigh1));

PercZoneLow2 = Param("PercZoneLow2",0.00001,0.000001,1,0.05) ;
PercZoneHigh2 = PercZoneLow1 ;

// in case of time consuming array avoid to calculate 3 times
arraylongtobecalculated = al = ATR(14);

Plot( al, "ATR(14) in zone", colorRed, styleLine | styleOwnScale, MinZone(al,PercZoneLow2,PercZoneHigh2), MaxZone(al,PercZoneLow2,PercZoneHigh2));

--- In amibroker@xxxxxxxxxps.com, "polomorabe" <polomora@xx.> wrote:
>
> Hello,
>
> I would like to plot four symbols in four different zones of an indicator pane. So the first 25% of the pane would be used for the first symbol, the next 25% for the second symbol, etc.
>
> I don't need to display scaling on the vertical axis.
>
> Thanks,
> Paul
>



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___