[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?


  • Date: Sun, 6 Dec 2009 02:01:25 -0600
  • From: "Joris Schuller" <jschuller@xxxxxxxxxxx>
  • Subject: RE: [amibroker] Re: Is it possible to divide an indicator pane into several zones?

PureBytes Links

Trading Reference Links



Bisto,

 

You might want to replace:

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

By:

Plot( C, "C in zone"+WriteVal(MinZone(L,PercZoneLow1,PercZoneHigh1),2.5), colorBlack,

styleCandle | styleOwnScale, MinZone(L,PercZoneLow1,PercZoneHigh1),MaxZone(H,PercZoneLow1,PercZoneHigh1));

This reduces the amount of (occasional) overlap between the values in the two panes (for example in Forex with volatile ATR and Price), if you want to use your function approach (in the functionless mode there is no overlap).

 

The problem I always have had with putting 2 or more /indicators/panes in one pane, was that only the last indicator has a scale, which is only correct when the bottom section is expanded to 100 percent and furthermore that there is no way of turning of that scale (if you have a way, please let me know). It seems simple to ignore that scale, but often it appears that I want to know the values of the first function and that I am drawn to that scale like a magnet and its mismatch for the last function annoys me.

 

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Bisto
Sent: Wednesday, November 18, 2009 4:32 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Is it possible to divide an indicator pane into several zones?

 

 

Hello Joris,

> 1. You compute the HHVMax (C) and LLVMin(C) rather than HHVMax (H) and
> LLVMin(L), which can cause some overlap

True. I used C just as an example but if the need is to plot price your comment is perfect

> 2. In the presence of RHS blank bars an error message appears.
>

True, as discussed with Faragasso

> 3. Since AB 5.25 (I believe) there are two undocumented functions
> HighestVisibleValue() and LowestVisibleValue();

this helped a lot (I missed those new functions, Thanks to Tomasz) solving:

a) the blank bars bugs
b) the case if the indicator is still EMPTY as at the very first bars

I still prefer the fuction approach because I believe that it's more comfortable, but, of course, it's a personal approach

here below the code revised

thank you very much

Bisto

function MinZone( array, PercZoneLow, PercZoneHigh )
{
HHVMax = HighestVisibleValue( array );
LLVMin = LowestVisibleValue( array );

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

return MinZ ;
}

function MaxZone( array, PercZoneLow, PercZoneHigh )
{
HHVMax = HighestVisibleValue( array );
LLVMin = LowestVisibleValue( array );

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));

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.425 / Virus Database: 270.14.67/2506 - Release Date: 11/16/09 07:43:00



__._,_.___


**** 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

__,_._,___