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

[amibroker] Re: TimeFrames: Is their use flawed?



PureBytes Links

Trading Reference Links

Hi AF,

OK, I understand! Your code is really compact and fast! But unfortunately there seems to be a few problems...

If you compare your code with a 15 min interval chart running bar replay- side by side- the values you get are not correct. 

If I am not wrong, first you must add expandFirst to:
MA_TF_Base = TimeFrameExpand(MA_TF,in1Minute * TF, expandFirst);
So you get the same values.

Then if you add my code and plot 15 min, you will see that yours and mine have only the same values on some 1 min bars, but not all. I have double checked my results, so I am 99.99% sure those are correct.
Any idea what cause this difference?

Then for more complex calculations/indicators such as Stochastic, you still would need to use a loop- right?

Jorgen





--- In amibroker@xxxxxxxxxxxxxxx, "af_1000000" <af_1000000@xxx> wrote:
>
> Hi Jorgen,
> 
> Since you have not explained in details what you "method" is I took your example as a proxy what it is all about. Your code says quite explicitly : for any higher timeframe CURRENT period take values from PREVIOUS higher timeframe periods  and add values from the current period but at the current lower resolution. That's what your code says and does when calculating Close for MA. I just made your code more efficient (it gives the same result) and compared the outcome (bright green color) to the outcome from the the "traditional" method (yellow color). For illustration purposes I marked higher timeframe bars (histogram) and indicated CLOSE from higher timeframe on lower timeframe (red color). This is all I have done.  The difference is quite explicit: MA does not wait till the end of the higher time period, but includes current lower timeframe values. Therefor MA is either lower (down trend) or higher (up trend) when comparing to traditional method. The alternative method would be to calculate MA on lower timeframe equivalent to period = Period of the higher timeframe  * (interval of the higher timeframe / interval of the lower timeframe) eg. MA(C,10) on 15min chart would be equivalent to MA(c,150) on 1min chart.
> 
> Regards,
> 
> AF
>




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

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

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/