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

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



PureBytes Links

Trading Reference Links

Jorgen,

Your data looks like your are using a trick I have been using for many  
years.  I do the timeframe calculation for higher timeframes, but  
instead of aligning it on timeframe unit boundaries, I calculate it at  
every lowest timeframe boundary.  It is a lot more calculations, but  
the results are continuous.  It is like calculating a 10 bar MA on 10  
minute bars by doing a 100 bar MA on 1 minute bars.  This is good for  
some uses, but you lose the filtering effect of timeframe bars which  
is good for other uses.

BR,
Dennis

On Aug 14, 2009, at 7:11 AM, jorgen_wallgren wrote:

> Hi there!
>
> You should be able to see one set of data here with Normal vs Hig  
> res data:
>
> http://smg.photobucket.com/albums/v325/wallgrenj/AmiBroker/?action=view&current=Normal3TFvsNotNormal.jpg
>
> Regards,
>
> Jorgen
>
> --- In amibroker@xxxxxxxxxxxxxxx, "sidhartha70" <sidhartha70@xxx>  
> wrote:
>>
>> Jorgen,
>>
>> Interesting discussion.
>> I have to admit that I'm finding it difficult to visualize exactly  
>> what you are suggesting. Would you mind posting a screen shot  
>> somewhere that we can see as an example of how you are using time  
>> frames differently...?
>>
>> TIA
>>
>> --- In amibroker@xxxxxxxxxxxxxxx, "jorgen_wallgren"  
>> <jorgen.wallgren@> wrote:
>>>
>>> Thank you Tomasz and Dennis for your input and comments! First of  
>>> all, the classic future leak error is taken care of, but it's not  
>>> clear in the short code example I gave. Thank you!
>>>
>>> Then I agree with what you say Tomasz, and my solution is not what  
>>> we would call a normal multiple timeframe system. But that's also  
>>> the whole idea with it. Because as a day trader I basically want  
>>> to know what's going on every mS.  I don't sit and wait for a 1, 5  
>>> or 15 min bar to be completed before I take a decision. I look at  
>>> it and try to figure out where it's going. And here is where my  
>>> data sampling is created in such way it gives me continuous  
>>> timeframe data so I can tell with very high probability where the  
>>> price is heading. Then why waste chart space when all timeframe  
>>> data can be in the same chart! But to be clear and easy to  
>>> interpret, it then has to have the same resolution.
>>>
>>> The power of timeframes in day trading is when people using  
>>> different timeframes "start to agree" where the price should go-  
>>> and as a result you have high probability trades in front of you.  
>>> But it's of course more to it than that. :-)
>>>
>>> Regards,
>>>
>>> Jorgen
>>>
>>> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@> wrote:
>>>>
>>>> Hello,
>>>>
>>>> Thank you for your post.
>>>> That kind of explanation of what you are after I was expecting  
>>>> and I am glad you posted it because
>>>> now we can discuss facts not opinions. I was not expecting  
>>>> appologies, but just the information what you are after and you  
>>>> delivered
>>>> it now.
>>>> Thank you.
>>>>
>>>> To the matter - there seems to be some kind of misunderstanding  
>>>> what AmiBroker's built-in time frame functions
>>>> are for. To make it straight - they are provided to build the  
>>>> systems based on many time intervals in exactly the same
>>>> way as human would do, looking at 2 or more charts at the same  
>>>> time.
>>>> Imagine you have the system that looks onto daily and weekly  
>>>> chart. That is exactly the purpose of time frame functions.
>>>> So time frame functions allow you to get the "weekly" data from  
>>>> within "daily" chart. As in weekly chart, there is ONE
>>>> open, ONE close, ONE high and ONE low PER WEEK. That is exactly  
>>>> what you would see on the weekly chart if
>>>> you combined daily and weekly "by eye".
>>>> Not only that, you will know weekly high/low and close values  
>>>> only when week has ended (on Friday close).
>>>> And that is exactly how AmiBroker's timeframe functions work -  
>>>> they give you the value of higher timeframe
>>>> at the bar when higher interval is completed.
>>>> The manual
>>>> http://www.amibroker.com/guide/h_timeframe.html
>>>> gives example of so called "triple Elder screen" that combines  
>>>> signals generated in daily and weekly timeframes.
>>>>
>>>> What you are doing with your functions is different, you are not  
>>>> creating higher timeframe data at all.
>>>> What you do is some gated data sampling. The following code will  
>>>> generate something like that,
>>>> you will get upto 5 different "weekly" values per one week,  
>>>> instead of one, as you wanted:
>>>>
>>>> newframe = TimeFrameExpand( BarIndex(), inWeekly );
>>>> newframe = newframe != Ref( newframe, -1 );
>>>>
>>>> SteppedHigh = HighestSince( newframe, High );
>>>> SteppedLow = LowestSince( newframe, Low );
>>>>
>>>> Plot( SteppedHigh, "SteppedHigh", colorBlue );
>>>> Plot( SteppedLow, "SteppedLow", colorBlue );
>>>> Plot( C, "Price", colorBlack, styleCandle );
>>>>
>>>> There are two caveats however:
>>>> - such approach is not equivalent to "normal" mutiple timeframe  
>>>> system that only uses data from *completed* interval
>>>> - as Dennis pointed out in his reply, such approach may very  
>>>> quickly lead to classic future leak error,
>>>> because you may be using your "quick weekly" data before they are  
>>>> settled.
>>>>
>>>> (The above uses daily/weekly intervals for illustration purposes,  
>>>> but the same applies to any time frame).
>>>>
>>>> Best regards,
>>>> Tomasz Janeczko
>>>> amibroker.com
>>>> ----- Original Message -----
>>>> From: "jorgen_wallgren" <jorgen.wallgren@>
>>>> To: <amibroker@xxxxxxxxxxxxxxx>
>>>> Sent: Thursday, August 13, 2009 4:18 PM
>>>> Subject: [amibroker] Re: TimeFrames: Is their use flawed?
>>>>
>>>>
>>>> If I have offended you, I am sincerely sorry! AmiBroker is the  
>>>> best program available and I love working with it!!! Nothing wrong
>>>> with AB!!!
>>>>
>>>> One of the reasons the TF Functions didn't do the job in my  
>>>> specific case was that my systems works with 1, 5 and 15 minute
>>>> timeframes. In the chart I need to see (and save) all the values  
>>>> from all the TFs plotted with 1 minute resolution. Basically to
>>>> plot the TF data as a staircase is probably the best way to  
>>>> display the results for easy viewing and it's actually often so  
>>>> that
>>>> some TF values in a 1 minute resolutions often very closely  
>>>> follow a staircase pattern- such as a Moving Average. But the AB TF
>>>> Functions gives me the last value for each period. I needed more.  
>>>> Now when I have all values in each period it reveals huge amount
>>>> of information when the three time frames are plotted in one  
>>>> indicator with the same data resolution. For example instead of 1  
>>>> value
>>>> for a 15 minute period, I have now 15 values.
>>>>
>>>> Then I wouldn't like to go so far to prove my point by publish  
>>>> the work and system I have been working on for months. I have a
>>>> system which seems to work rather well and I am sorry, but that  
>>>> one I will keep for myself. I could send anyone who wants a screen
>>>> capture of the indicator with data from 3 TFs plotted.  But such  
>>>> a screen capture could be faked. So I will instead give a short
>>>> explanation how easy it is to create what I was looking for. And  
>>>> the reason it was easy to create, after I figured it out, was
>>>> because AmiBroker is a great program with fantastic features.
>>>>
>>>> First of all, I use AB TF Functions to get the BarIndex in each  
>>>> TF. By having that I can tell when each TF has a new period, and  
>>>> any
>>>> holes doesn't matter. Then I just go in a loop from first visible  
>>>> bar - as many bars I need extra, until end of the array. So in
>>>> this loop when a new period is detected, I jump 1 step back and  
>>>> collect the values I need and the jump is equal to the TF I need
>>>> data from. Here is a part of that code:
>>>> if ( NewTFBar[i] )
>>>>        {
>>>>            for ( n = i; Counter < Periods AND n >= 0 ; n-- )
>>>>            {
>>>>                if ( NewTFBar[n] )
>>>>                {
>>>>                    SUMA = SUMA + Close[ n - 1 ];
>>>>                    if ( Counter < BBPeriods - 1 )
>>>>                        SUMB = SUMB + Close[ n - 1 ];
>>>>
>>>>                    Counter++;
>>>>                }
>>>>            }
>>>>     Etc.
>>>> I hope that settles it and again it's not my intention to talk  
>>>> bad about AmiBroker or to insult anyone.
>>>>
>>>> Regards,
>>>>
>>>> Jorgen
>>>>
>>>>
>>>>
>>>> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@>  
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> TimeFrame functions work perfectly.
>>>>> You may not understand them but it is not the reason to send  
>>>>> such unjustified opinions.
>>>>>
>>>>> If you "wrote your own" why don't you publish your formulas so  
>>>>> everyone can judge?
>>>>> Otherwise it is just plain useless talk.
>>>>>
>>>>> Best regards,
>>>>> Tomasz Janeczko
>>>>> amibroker.com
>>>>> ----- Original Message -----
>>>>> From: "jorgen_wallgren" <jorgen.wallgren@>
>>>>> To: <amibroker@xxxxxxxxxxxxxxx>
>>>>> Sent: Thursday, August 13, 2009 10:59 AM
>>>>> Subject: [amibroker] Re: TimeFrames: Is their use flawed?
>>>>>
>>>>>
>>>>>> Herman, I agree with you and I have the same questions. I have  
>>>>>> been working on a RT system using data from 2 additional time
>>>>>> frames and the result was very clear! I can't use the AB  
>>>>>> TimeFrame Functions and get a system which works in real time  
>>>>>> and can
>>>>>> also be properly be back tested.
>>>>>>
>>>>>> Therefore I wrote my own TimeFrame Function and now when I have  
>>>>>> the data from the 2 longer timeframes in the same resolution as
>>>>>> my
>>>>>> chart interval, 1 minute,  everything works very well.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Jorgen
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------
>>>>>>
>>>>>> **** 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
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------
>>>>
>>>> **** 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
>>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> **** 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
>
>
>



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

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