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

[amibroker] Re: Question on VarSet and VarGet for Tomasz and programming gurus



PureBytes Links

Trading Reference Links

Here is an example to convert to rounded decimal places 

Dec = iif( xxx < 0.1, 0.001, iif( xxx>=0.1 and  xxx < 0.5, 0.005, 0.01 ));

Price = round( xxx/dec ) * dec;

Another to just show decimal places in a title

dec = IIf(xxx<0.5,1.3,1.2);

WriteVal(xxx,LastValue(Odec))


Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: Glenn [mailto:glennokb@xxxxxxxxxxxx] 
Sent: Monday, July 12, 2004 5:02 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Price Steps

Hi,

I would like to change my trailing stop so that it matches market
convention regarding price steps.

For example:
>From 10 cents To 49.5 cents price steps are 0.5 cents.

If my trailing stop value is say 34.1567, I would like this to simply
show 34.5.

I had a look at the functions ceil(), round() and floor() but they go
to the higther/lower/closest integer. Any ideas please?

Cheers Glenn




Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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/