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

[amibroker] Resolved: Re: Inability to get correct values when switching time frames



PureBytes Links

Trading Reference Links

Actually, I found TimeFrameGetPrice() after I wrote this. RTFM ;>)
It works great and it's just one line of code, or you can use it with a for loop...

--- In amibroker@xxxxxxxxxxxxxxx, James <jamesmemphis@xxx> wrote:
>
> Try this:
> 
> TimeFrameSet( inDaily);
> 
> C1 = ref(C,-1) ; 
> C2 = ref(C,-2); 
> C3 = ref(C,-3);
> C4 = ref(C,-4);
> C5 = ref(C,-5); 
> 
> TimeFrameRestore( ); //to go back to 3 minute interval
> then try one of these:
> 
> C1 =  TimeFrameExpand( C1, inDaily); 
> C1 =  TimeFrameExpand( C1, inDaily, expandLast); 
> C1 =  TimeFrameExpand( C1, inDaily, expandFirst); 
>  
> Plot ( C1, "Close -1", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
>  
> and so on for C2, C3, etc. I wish I could tell you the difference between the 3 but I have not been able to really comprehend it after 3 days of working with it.
> 
> 
> 
> ________________________________
> From: interfool <02@xxx>
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Tuesday, June 9, 2009 3:07:08 PM
> Subject: [amibroker] Inability to get correct values when switching time frames
> 
> 
> 
> 
> 
> I am trying to switch timeframes from a 3 minute to a daily and then back on an exploration. I start off with a 3 minute interval. All I want to do with the daily interval is get the closing values of the last 5 bars. It acts really funny, despite trying different combinations of TimeFrameSet and TimeFrameExpand or Compress.
> 
> Shouldn't I just be able to do: (and have C1 thru C5 hold values or CD hold an array of daily values)
> 
> TimeFrameSet( inDaily);
> 
> C1 = ref(C,-1) ; //grab last 5 closing values on daily interval
> C2 = ref(C,-2); //this does not work
> C3 = ref(C,-3);
> C4 = ref(C,-4);
> C5 = ref(C,-5); 
> //or:
> CD = C ; //CD should hold an array of daily values, but it doesn't work eitherâ?¦
> 
> TimeFrameRestore( ); //to go back to 3 minute interval
> 
> It seems to kinda work if I issue a TimeFrameExpand( C,in1minute) , but not really. When I run the exploration, the correct values only come up on later in the day iterations of the same stock. I want the last 5 values of the daily interval regardless of how often the stock comes up on the 3 minute interval. Any ideas?
> 
> Thanks,
> 
> interfool
>




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

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