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

[amibroker] Re: AFL floating point number representation?



PureBytes Links

Trading Reference Links

> If you are writing software from scratch, you can use the 
>appropriate
> data types for your application -- you have complete control. 
>Packing
> data is unnecessary unless you have memory constraints.

Thanks, Steve.

That was great.

Wikipedia/datatypes and the links took me straight to what  I needed.

I was thinking about things like defining types, alternative encoding 
(implied decimals, fixed point etc), alignment, nibbles, memory 
access and all that stuff.

I was emboldedened by the fact that I only have around 3-4 pieces of 
data to handle at the lower level.

I was also thinking about words and packing.

I see now that commericial programs are constrained by the common 
deniminator of hardware/CPU's etc .... different story to write for 
oneself with a purpose bought machine.

Anyway, I found what I was looking for.

I was really talking about the uni dimensionality of memory and how 
to correlate that to matrices.

I see now that multidimensional arrays is what I am after (I asked 
the forum about multidimensional matrices).

What I am wondering is if a multidimensional array would be better to 
store the data like so:

IndexedOneDimensionalArray[A: price,timein,timeout;Bprice,timein,time 
out]

OR IODA.price[a,b],IODA.timein[a,b],IODA.price[a,b]

OR as three indexed arrays for price, timein and timeout.

In the end I need the array of arrays:

price[a,b]
timein[a,b]
timeout[a,b]
        
Since price, time in and timeout are, or could be intergers (same 
datatype) they could go in one chronology if it is easier/faster .... 
I will have to think about that now.

I don't think C++ is the best array language but I guess it can do a 
reasonable job for my middle of the road needs/computer.

Thanks for your help.

BTW my backtester is more of a thought experiment, than a reality, at 
this stage.

--- In amibroker@xxxxxxxxxxxxxxx, "hydroblue@xxx" <hydroblue@xxx> 
wrote:
>
> Brian, 
> 
> The PositionScore and PositionSize arrays are an efficient way to 
move
> data between the backtester phases. I don't control the interface, 
so
> I am doing something unusual to stuff more data through a narrow 
pipe.
> 
> If you are writing software from scratch, you can use the 
appropriate
> data types for your application -- you have complete control. 
Packing
> data is unnecessary unless you have memory constraints.
> 
> -Steve
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "brian_z111" <brian_z111@> wrote:
> >
> > I have been thinking about this, since I started mulling over how 
to 
> > design a PowerBackTester
> > 
> > I will only have to read/write 3 core metrics, in and out of 
memory 
> > (all other BT metrics can be calc from them on the fly).
> > 
> > I have price = 1.0277 (2.77 %)
> > plus in and out time (either datenum or timenum etc depending on 
base 
> > timeframe).
> > 
> > I might also need to store additional data with the trades e.g. 
RSI 
> > value for ranking signals.
> > 
> > For warp speed I am wondering how to get 3 or more units of data 
in 
> > one memory series .... I wonder if it would be quicker keep all 
the 
> > data that belongs to one trade together and thenunpack the serial 
> > data, in RAM, into 3 the or more arrays required i.e. the 
collection 
> > of arrays that make up the trade matrix?
> > 
> > Don't know anything about bit consumption per integer etc or 
> > progamming/computers.
> > 
> > I keep coming back to the idea of making 2 * 32 bits operate like 
a 
> > pseudo 64 bits (and onwards)?
> > 
> > Anyone heard of this ... it's probably standard computer practise 
or 
> > maybe a crazy idea?
> > 
> > 
> > 
> > 
> >  --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@> wrote:
> > >
> > > How many bits are your numbers?
> > > 
> > > Two 11 bit integers can be be packed and unpacked from one 32 
bit  
> > > float number with ease.  You just mask (&) bits to extract the 
low  
> > > order number.  Use multiply or divide to shift the low to the 
high  
> > > half of the number and back to the low half again.  Simple bit  
> > > arithmetic.
> > > 
> > > Though it seems there should be easier ways to get what you 
want.  
> > I  
> > > am not a CBT user though.
> > > 
> > > BR,
> > > Dennis
> > > 
> > > 
> > > On Feb 7, 2009, at 7:57 PM, hydroblue@ wrote:
> > > 
> > > > Thanks Tomasz. I'm looking for a clever way to stuff two 
numbers 
> > into
> > > > the 32 bit float and then later extract the 2 numbers.
> > > >
> > > > // fraction = 23 bit integer
> > > > // exponent = 8 bit integer
> > > >
> > > > The reason for doing this is to efficiently get an extra 
array of
> > > > numbers into the portfolio backtester without thousands of 
static 
> > vars
> > > > or Foreign symbols.
> > > >
> > > > Is there a way to do this in AFL without writing a DLL?
> > > >
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" 
<groups@>  
> > > > wrote:
> > > >>
> > > >> Hello,
> > > >>
> > > >> IEEE 754 Standard floating point (32 bit, single precision)
> > > >> http://en.wikipedia.org/wiki/IEEE_754-1985
> > > >>
> > > >> Best regards,
> > > >> Tomasz Janeczko
> > > >> amibroker.com
> > > >> ----- Original Message -----
> > > >> From: <hydroblue@>
> > > >> To: <amibroker@xxxxxxxxxxxxxxx>
> > > >> Sent: Saturday, February 07, 2009 5:13 PM
> > > >> Subject: [amibroker] AFL floating point number 
representation?
> > > >>
> > > >>
> > > >>> I need to know what range of values and what precision can 
be
> > > >>> represented in the AFL floating point arrays, specifically 
the
> > > >>> PositionSize array.
> > > >>>
> > > >>> It would also be useful to know how many bits are available 
in 
> > the
> > > >>> mantissa and exponent. Any help appreciated.
> > > >>>
> > > >>> Thanks,
> > > >>> Steve
> > > >>>
> > > >>>
> > > >>>
> > > >>> ------------------------------------
> > > >>>
> > > >>> **** IMPORTANT ****
> > > >>> This group is for the discussion between users only.
> > > >>> This is *NOT* technical support channel.
> > > >>>
> > > >>> *********************
> > > >>> TO GET TECHNICAL SUPPORT from AmiBroker please send an e-
mail
> > > > directly to
> > > >>> SUPPORT {at} amibroker.com
> > > >>> *********************
> > > >>>
> > > >>> For NEW RELEASE ANNOUNCEMENTS and other news always check 
> > DEVLOG:
> > > >>> http://www.amibroker.com/devlog/
> > > >>>
> > > >>> For other support material please check also:
> > > >>> http://www.amibroker.com/support.html
> > > >>>
> > > >>> *********************************
> > > >>> Yahoo! Groups Links
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > >
> > > >
> > > >
> > > >
> > > > ------------------------------------
> > > >
> > > > **** IMPORTANT ****
> > > > This group is for the discussion between users only.
> > > > This is *NOT* technical support channel.
> > > >
> > > > *********************
> > > > TO GET TECHNICAL SUPPORT from AmiBroker please send an e-
mail  
> > > > directly to
> > > > SUPPORT {at} amibroker.com
> > > > *********************
> > > >
> > > > For NEW RELEASE ANNOUNCEMENTS and other news always check 
DEVLOG:
> > > > http://www.amibroker.com/devlog/
> > > >
> > > > For other support material please check also:
> > > > http://www.amibroker.com/support.html
> > > >
> > > > *********************************
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > >
> >
>




------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/