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

[amibroker] Re: Graph paper background



PureBytes Links

Trading Reference Links

Here is a complete "Graph Paper" solution that self-adjusts for
selected symbol and number of bars viewed. I have made it an Include
file for my use. (Watch for line wraps.)

//Vertical lines:

bars = LastValue(Cum(Status("barvisible")));
Vbars = round(bars/15 + 0.5);
Plot(BarIndex() % vbars == 0,"",colorGrey50,styleHistogram |
styleOwnScale, 0,1);

//Horizontal lines:

Highshowing = LastValue(BarsSince(Status("barvisible")));
Lowend = LastValue(Ref(LLV(L,bars),-Highshowing));
Highend = LastValue(Ref(HHV(H,bars),-Highshowing));
ink = (Highend - Lowend) / 10;
printf("\n\nbars %1.0f, low %1.0f, high %1.0f, highest vis %1.0f, inc
%1.2f",bars,Lowend,Highend,Highshowing,ink );
for (x = Lowend - ink; x <= Highend + ink; x = x + ink) //Adjust range
and increments as needed
Plot(x,"",colorGrey50,styleNoRescale | styleNoLabel);

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
>
> I knew modulus was somewhere...just couldn't find it in HELP! As b
> mentioned, HELP is nice if you know what you want! For example, try to
> find "user-defined function" using search. Can't do it.
> 
> Anyhow, thanks for the simplification.
> --
> Terry
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
> Behalf Of scourt2000
> Sent: Thursday, November 17, 2005 11:09
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Graph paper background
> 
> 
> Terry, it's more efficient to code it up like this:
> 
> Plot((BarIndex() % 5) == 0,"",colorGrey50,styleHistogram | 
> styleOwnScale, 0,1);
> 
> Use the mod (%) operator in preference to division whenever you 
> can.  Of course, the parens are extraneous since the operator 
> precedence would parse the expression the same, but it saves a bug 
> later if the expression became more complicated (i.e. using OR's and 
> AND's with and missing a paren combo to group the OR's correctly).
> 
> Steve






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/