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

Re: [amibroker] Re: Advances in TA: Event flags



PureBytes Links

Trading Reference Links

Hello,

There is even better way to code "binary" fields into OHLC fields
using bitwise AND and OR operators:

Lets say that you have 8 events: Event0 upto Event7
You can ancode them so 
Event0 = 1
Event1 = 2
Event2 = 4
Event3 = 8
Event4 = 16
Event5 = 32
Event6 = 64
Event7 = 128

Now if you want to store the day when Event3, Even5 and Event7
occurs you can just
assign 8+32+128 as a closing price.

Now from AFL level you can use

IsEvent3 = Foreign("IBM_Flags", "C" ) & 8;
IsEvent5 = Foreign("IBM_Flags", "C" ) & 32;
IsEvent7 = Foreign("IBM_Flags", "C" ) & 128;

That way you can store upto 23 events in single price field,
so in OHLCVOI you can store 138 events.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "b519b" <b519b@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, July 26, 2002 5:03 PM
Subject: [amibroker] Re: Advances in TA: Event flags


> There is an effective work around to do this by making an artificial 
> ticker for each stock and then using the Foreign() call for testing.
> 
> For example, for IBM create a ticker IBM_Flags
> Put your info into the various price and volume field. That will 
> give you 6 data items. If you want 10 fields, divide the O, H, L, C 
> fields in half using the decimal point. It is easy to use AB's 
> Fraction and Integer calls to get what you want.
> 
> If you need a lot of data fields, you can "pack" the data into each 
> digit of the price and volume fields. And then use AB's Fraction and 
> Integer calls with appropriate division and multiplication to get 
> the data items separated. Theoretically you should be able to get 6 
> digits in the price fields and 9 in the volume and OI fields. But 
> for safety you can use 5 from each. Also, you can pack 9 digits into 
> the volume and oi fields, but you can only extract 6 digits since AB 
> usings changes the data in these fields to decimal data (only 6 
> significant digits) to do the multiplication and division functions. 
> Even with just using 5 in each of the 6 regular fields, that gives 
> you 30 data fields, each with a range of 0 to 9.
> 
> b
> 
> --- In amibroker@xxxx, 520001085531-001@xxxx wrote:
> > Some thoughts from a new user:
> > 
> > What is missing in today's EOD TA packages is the
> > lack of storing "events" with the daily data and the ability
> > to use this information in formulae. 
> > 
> > These events do not need to take up much space.
> > In fact they can be bit fields (Yes/No, True/False values).
> > Using only 4 bytes for this would allow us such 32
> > independent event flags.
> > 
> > These event flags could be picked from a predefined
> > list, or be user-defined. For example:
> > 
> > COMPANY_CRISIS
> > MARKET_CRISIS
> > BAD_NEWS
> > GOOD_NEWS
> > BAD_RATINGS
> > GOOD_RATINGS
> > STOCK_SPLIT
> > 
> > ER_BEFORE_MARKET_OPEN
> > ER_DURING_MARKET_OPEN
> > ER_AFTER_MARKET_OPEN
> > ER_BELOW_EXPECTATIONS
> > ER_MEETS_EXPECTATIONS
> > ER_ABOVE_EXPECTATIONS
> > ...
> > 
> > Such events have an impact on the price. And they answer
> > the question of (dramatic) price changes on a specific day(s).
> > 
> > By having this (optional) information with each EOD data
> > one could develop better strategies/programs by filtering
> > any of the (un)wanted events.
> > 
> > I hope, one day AmiBroker will have this feature implemented :-)
> > (... or is it already possible? :-)
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>