The mathematical rule is, if the last decimal digit is a 5 or higher, round
up, otherwise round down.
Be consistent with whatever rule you follow.
From: amibroker@yahoogroups.com [mailto:amibro...@yahoogroups.com] On Behalf
Of sanjiv
Sent: Friday, June 25, 2010 8:12 AM
To: amibroker@yahoog
Something useful for the group,
http://www.ninjatrader.com/support/forum/showthread.php?t=7582
Enjoy
Cheers
Dave
On 13/06/10 10:32 PM, "David Weir" wrote:
>
>
>
>
>
>
> Hi
>
> Rounding the value from a formula, for a futures contract, to its Tick size
> for a buy entry price.
Something along these lines should work:
w = number;
x = int(w);
y = iif(frac(w) > 0 and frac(w) <= .25, .25,
iif(frac(w) > .25 and frac(w) <= .5, .5,
iif(frac(w) > .5 and frac(w) <= .75, .75, 0)));
z = iif( y > 0, x + y, x + 1);
Bill
- Original Message -
From: treat
0.25 * floor( number * 4 ); ; // this rounds down
0.25 * floor( 0.5 + number * 4 ); // this rounds to nearest
Best regards,
Tomasz Janeczko
amibroker.com
- Original Message -
From: "treatmentinprogress" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, September 16, 2008 7:41 PM
Subject: [amibroke
--
From: ChrisB
To: amibroker@yahoogroups.com
Sent: Monday, October 29, 2007 12:10 PM
Subject: Re: [amibroker] rounding
Not sure if this is what you want:
Right click chart
Parameters
Axes and grid
Grid
Show middle lines >> No.
??
ChrisB
OptionTed wrote:
>
s scaling (ones provided by default).
>
>
>
> - Original Message -
> *From:* wavemechanic <mailto:[EMAIL PROTECTED]>
> *To:* [EMAIL PROTECTED] ps.com <mailto:amibroker@yahoogroups.com>
> *Sent:* Monday, October 29, 2007 1:35 AM
> *Su
OK, understand. Not aware that this is an option but would be nice in order to
clean things up.
Bill
- Original Message -
From: OptionTed
To: amibroker@yahoogroups.com
Sent: Sunday, October 28, 2007 10:35 PM
Subject: Re: [amibroker] rounding
Bill, Thank you for your
: [amibroker] rounding
http://www.amibroker.com/guide/h_indbuilder.html
- Original Message -
From: OptionTed
To: amibroker@yahoogroups.com
Sent: Sunday, October 28, 2007 8:23 PM
Subject: Re: [amibroker] rounding
Thanks for that.
Is it also possible not to
http://www.amibroker.com/guide/h_indbuilder.html
- Original Message -
From: OptionTed
To: amibroker@yahoogroups.com
Sent: Sunday, October 28, 2007 8:23 PM
Subject: Re: [amibroker] rounding
Thanks for that.
Is it also possible not to display y-axis gridline values?
As
Thanks for that.
Is it also possible not to display y-axis gridline values?
As I wish to display my own S/R lines?
Thanks
- Original Message -
From: J. Biran
To: amibroker@yahoogroups.com
Sent: Sunday, October 28, 2007 6:03 PM
Subject: RE: [amibroker] rounding
buyprice = Prec(C,2);
Joseph Biran
-Original Message-
From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Graham
Sent: Sunday, October 28, 2007 2:35 AM
To: amibroker@yahoogroups.com
Subject: Re: [amibroker] rounding
You
As per Graham's note, rounding to 1 cent is something like
Floor(Price*100)/100.
Rounding to 0.5 cent is Floor(Price*200)/200
Rounding to 0.1 cent is floor(Price*1000)/1000.
Try a few of these in excel to see how it works & get the rounding you
want. Round, ceil & floor all do similar func
You can use something like this to 2 decimal places
round(C*100)/100
--
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com
On 28/10/2007, holygrail168 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> my buyprice functions are calculating values which go something like
>
> 7.395678
>
> since th
X = Round(X * 100) / 100;
Where X = your number
--
Terry
-Original Message-
From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of cdepuy
Sent: Thursday, June 22, 2006 12:06
To: amibroker@yahoogroups.com
Subject: [amibroker] rounding
what is the easiest way to round a val
Cool - that looks like exactly what I'm after, Paul - thanks very much.
I'll give it a fly now.
Martin
Paul Ho wrote:
> you can make your own, something like the following, I havent tested yet
> function RoundDec(Number, decimal)
> {
> pwr = 10^decimal;
> result = round(Number * pwr) / p
http://www.amibroker.com/f?prec
Best regards,
Tomasz Janeczko
amibroker.com
- Original Message -
From: "Martin Cooney" <[EMAIL PROTECTED]>
To: "Amibroker General Forum"
Sent: Thursday, March 02, 2006 11:11 AM
Subject: [amibroker] rounding decimal places
> Hi,
>
> Is there a function I
you can make your own, something like the following, I
havent tested yet
function RoundDec(Number, decimal)
{
pwr =
10^decimal;
result = round(Number * pwr) /
pwr;
return result;
}
From: amibroker@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Martin
CooneySent: Thur
you can try this for 2 dec places
round( C*100)/100
prec cuts off the decimal places
--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm
On 3/2/06, Martin Cooney <[EMAIL PROTECTED]> wrote:
> Hi,
>
18 matches
Mail list logo