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

[amibroker] Re: Help with 2 simple BUY conditions



PureBytes Links

Trading Reference Links

hello everybody,

could anybody tell me the exact algorithm of scaling an indicator that 
has GraphXSpace different from zero? I noticed that adding more plots 
(that are within the same boundaries as previous ones) changes Y 
scaling. I made some experiments to figure it out and some cases are 
obvious while others are not.

cheers,
BM


Post Scriptum:
I came into this while trying to write a few plots on one chart using 
styleOwnScale. I wanted them to be "in synch" with one another or 
occupied set ammount of space, no matter Y- and X-scaling. I also wanted 
not to loose Y-space if not necessary (for example when using LineArray 
with "no extended" option).

starting with the simple custom "indicator" (*Limits* and *Middle* marked):

Plot(100,"",colorRed);
GraphXSpace=0;

the plot is scaled so that 100 is the same as the bottom axis and 110 is 
the highest value for the top axis. OK. modyfying this code into:

Plot(100,"",colorRed);
Plot(101,"",colorRed);
GraphXSpace=0;

doesn't change anything: just another line appears, limits stay the 
same. now change the value of GraphXspace, eg.:

Plot(100,"",colorRed);
GraphXSpace=1;

now you can see that limits for Y asis are 110.1 and 99.9. this is as I 
supposed and the difference is just 1% of (110-100) (eg. with 
GraphXSpace=0) added/substracted to previous boundaries.

now add a line:

Plot(100,"",colorRed);
Plot(101,"",colorRed);
GraphXSpace=1;

you can see that although a new value of 101 is within previous 
boundaries of (99.9,110.1) the plot was *rescaled* so that new 
boundaries are shown as 99.8 and 110.2.

this simple example is to present more complicated issue: the more plots 
on a chart, the Y scaling changes when it is not necessary. additional 
plot eats Y-space.
I thought this would be be easy to figure out after a couple of 
experiments how it is going, but I'm stuck. Even the following examples 
are different.

Plot(109,"",colorRed);                    Plot(120,"",colorRed);
Plot(120,"",colorRed);       vs.          Plot(109,"",colorRed);
GraphXSpace=1;                            GraphXSpace=1;

so, could anybody give me any prescription for managing scaled plots 
more uniformly? the simple detection of the highest+lowest values on the 
chart doesn't work.

cheers,
BM


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/