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

Re: [amibroker] only the value of the last 2 digits possible ?



PureBytes Links

Trading Reference Links

there is normally always more than one to way to achiieve something

P = int(prec(C*100,2)*100);

On 6/20/05, TB <tzg@xxxxxxxxxxxxxxxx> wrote:
> 
> 
> Hi Terry,
> 
>  
> 
> Thank you very much, I will try it out.
> 
>  
> 
> Regards
> 
>  
> 
> Thomas
> 
> www.tradingbasis.com
> 
>  
> 
>  
> ________________________________
> 
> 
> Von: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] Im Auftrag
> von Terry
> Gesendet: Sonntag, 19. Juni 2005 19:28
> 
> An: amibroker@xxxxxxxxxxxxxxx
> Betreff: RE: [amibroker] only the value of the last 2 digits possible ?
> 
> An: amibroker@xxxxxxxxxxxxxxx
> Betreff: RE: [amibroker] only the value of the last 2 digits possible ?
> 
> 
> 
>  
> 
> 
> Functions only return a single value, but if you look at the code I just
> shifted the decimal point with * 100 and the int() function drops the
> fractional portion while the frac() function give you the fractional portion
> only. With those two AB functions you can easily do what you need.
> 
> --
> 
> Terry
> 
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of TB
> Sent: Sunday, June 19, 2005 09:56
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: AW: [amibroker] only the value of the last 2 digits possible ?
> 
> Hi Terry,
> 
>  
> 
> Is there also any way to get the result of the first values ? 
> 
> 1.2128 for example should give me the values:
> 
> 1.21
> 
> and 28
> 
>  
> 
> Regards
> 
>  
> 
> Thomas
> 
> www.tradingbasis.com
> 
>  
> 
>  
> 
>  
> ________________________________
> 
> 
> Von: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] Im Auftrag
> von Terry
> Gesendet: Sonntag, 19. Juni 2005 00:44
> An: amibroker@xxxxxxxxxxxxxxx
> Betreff: RE: [amibroker] only the value of the last 2 digits possible ?
> 
>  
> 
> 
> You can always make your own function:
> 
> 
> function sweetspot (x)
> {
>     x = (x * 100);
>     return int((x - int(x)) * 100);
> }
> 
> --
> 
> Terry
> 
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of TB
> Sent: Saturday, June 18, 2005 15:58
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] only the value of the last 2 digits possible ?
> 
> Hello,
> 
>  
> 
> I want to test a strategy based on sweetpoints (round numbers) for forex.
> 
> So I want to reduce the value like 1.2337 to 37, only the last 2 digits.
> 
>  
> 
> Is there any way to do this ?
> 
> I have found no function but maybe I have not seen it.
> 
>  
> 
> Regards
> 
>  
> 
> Thomas
> 
> www.tradingbasis.com
> 
>  
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 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 the Yahoo! Terms of Service. 


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


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/