PureBytes Links
Trading Reference Links
|
Hi guys,
I want to be sure that I understood correctly the use of higher timeframes in my backtesting, so here is my question:
TimeFrameSet( -1);//I'm using for backtesting tick data
//I compute below emas for each time frame
TimeFrameSet( in1Minute);
EMA5_1m= EMA (C,5);
TimeFrameRestore();
TimeFrameSet( in5Minute);
EMA5_5m= EMA (C,5);
TimeFrameRestore();
TimeFrameSet( 15*60);
EMA5_15m= EMA (C,5);
TimeFrameRestore();
The following will give me the values for each ema updated for each tick, tick by tick, not waiting for the candle to be completed (1min, 5 min or 15 min)?
TimeFrameExpand( Ref(EMA5_1m,0),in1Minute)
TimeFrameExpand( Ref(EMA5_5m,0),in5Minute)
TimeFrameExpand( Ref(EMA5_15m,0),in15Minute)
I mean, if I have 200 ticks during a 15 minute candle, I get 200 values for TimeFrameExpand( Ref(EMA5_15m,0),in15Minute)?
while the following will give me the emas values based on complete previous candle (1min candle, 5 min candle and respectively 15 min candle)?
TimeFrameExpand( Ref(EMA5_1m,-1),in1Minute)
TimeFrameExpand( Ref(EMA5_5m,-1),in5Minute)
TimeFrameExpand( Ref(EMA5_15m,-1),in15Minute)
I'm using the same principle as Jorgen for backtesting, but I'm not sure that I'm using correctly. I don't want to use the higher emas as staircases, but rather as "irregular" as Jorgen pointed out that image loaded by him. I don't want to wait for 15 min candle to be completed, but rather to take a decision based on its value at each tick.
Am I right? Or should I read again http://www.amibroker.com/guide/h_timeframe.html ? :-)
Thank you
--- In amibroker@xxxxxxxxxxxxxxx, "af_1000000" <af_1000000@xxx> wrote:
>
> I have not tried more complex indicators for one simple reason. If the higher timeframe compressed data contains all values I need (including incomplete last bar) I do not have to do anything . Build in indicators and my scripts will do everything for me. You calculate indicators on higher timeframe and expand them on a lower timeframe. If data compression on higher timeframe does not include everything you need you have to combine somehow data on higher timeframe with data on lower timeframe and invent new implementation of the indicators or create new intelligently combined weekly and data array, so build in indicators can use this array. That's why my preference is to fix data compression on the higher timeframe first before I start thinking about an exotic stuff.
> So far, I have used multiple charts to avoid unnecessary programming.
> I do not understand why you would use "expandFirst". Create two charts higher and lower timeframe in a layout and play bar by bar. I believe the code is correct. Of course, I did not test every possible case, that's why you found few mistakes. The main objective was to prove the concept and highlight the differences between "traditional" method and your method.
> Sometimes loops are more efficient than array processing especially when you use lastvalue, nested barssince, nested valuewhen,.. etc. Every situation is unique, so it is hard to say in advance what is the best implementation. Always check "Code check $ Profile" and "Display chart timing".
>
> 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/
|