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

[amibroker] Re: Calculating Pivot Points based on a different time frame



PureBytes Links

Trading Reference Links

Here are a couple of ways to capture the price at a given time.
Try these out and see if they work for you.
Method 1 - Compress and expand the array
mktCl = TimeFrameCompress(IIf(160000,C,Null),inDaily,compressHigh);
mktCl= TimeFrameExpand(Ref(IIf(160000,Close,Null),-1),inDaily,expandFirst);

Method 2 - Find the previous close without compression/expanding
bc=BarCount-1;
bi = BarIndex();
ymCL = LastValue(ValueWhen(Cross(TimeNum(),160000),C));
xmCL = bc-LastValue(BarsSince(Cross(TimeNum(),160000)>0));
Plot(ymCL,"",29,4|2048);
Plot(bi==xmCL,"",47,2|4|65536|32768|4096);
Plot(LineArray(xmCL,ymCL,bc,1),"",55,1);

The second plot statement will show which bar is selected for the array.  Check to make sure (by changing the time) to insure you are getting data from the correct bar.

David K.

--- In amibroker@xxxxxxxxxxxxxxx, "David" <dclayw@xxx> wrote:
>
> The example I'll use here is the FX market. I'm in Australia and all times on my charts are naturally my local time. By default the PP calculations are based on the previous days data starting at midnight on that previous day.
> 
> But (the generally accepted) FX market open is at 5pm in the US Eastern time zone, or 7am in my time zone. So whilst my charts should show my local time the pivots should be calculated and plotted on a 24 period 7am-7am, not 12am-12am as is done by default.
> 
> Does anyone know how to achieve this in Amibroker. Quotetracker caters for this.
>




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

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