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

Re: [amibroker] Separate MA for normal and after hours trading


  • Date: Thu, 25 Feb 2010 13:21:29 -0500
  • From: Keith McCombs <kmccombs@xxxxxxxxxxxx>
  • Subject: Re: [amibroker] Separate MA for normal and after hours trading

PureBytes Links

Trading Reference Links



Barry --
Calculating EMAs and MAs should be possible, and of only intermediate difficulty, using AFL.  EMAs will be a bit easier than MAs.  The reason being that calculating an EMA requires only 2 pieces of data, previous bar's EMA and this bar's data.  Of course, you will have to construct your own EMA because you will need to stop calculating each EMA at the end of its time period and then continue when its time period begins again.

As for MAs, they really require only 3 pieces of data, previous bars MA, this bars data, and data of one bar, P bars ago (in the correct time period), where P is MA period.

One problem you may run into, especially with off hours data, is what to do if volume is zero.  Is a bar created in this case?  If not, what are you going to do about it?

BTW,
AB&IB seems to create zero volume bars when backfills are complete, though 180days are problematic.  Some other data providers, PItrading for example, just leave zero volume bars out.

-- Keith



On 2/25/2010 12:06, Barry wrote:
 

I am trying to create two moving averages, one for normal trading hours volume and the other for the off hours volume. When futures are trading during the day the volume is much higher than off hours. Using an MA of say 50 bars gives an incorrect look at the volume until 50 bars into the new time period. However, if one were using hour or 15 minute charts the MA could span days. It would be clearer or more accurate if one could only use the applicable volume when calculating the MA for normal hours vs off hours trading.

Has this been done in AFL? Can it be done in AFL? Is there an AFL function that can separate the day and night session data? Can it be done in the context of AFL or would one have to use a DLL to build separate arrays that only contain values from the two time periods?

I have tried a number of methods in AFL but none work correctly. Managing the arrays in AFL and trying to ignore spans of bars is blowing my mind.

Thanks,
Barry



__._,_.___


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

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

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___