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

[amibroker] Ignore Sunday's High on Intraday Chart



PureBytes Links

Trading Reference Links

This one really has me stumped. The example below is a simplified
version of something I am trying to code. What I need is to write the
code so that it will ignore all values from Sunday's trading. Mainly
this will be applied to futures or forex contracts.
The code below is my best attempt and it does not work. Here is what
I'm trying to achieve. I would like to plot a line representing the
previous day's high. This will be used in an intraday chart and uses
TimeFrameSet() function. It works just fine with the exception of
futures contracts which begin trading on Sunday. I would like to plot
the line so that it ignores the high from Sunday and instead displays
Friday's high throught Monday's trading action.

_SECTION_BEGIN("Prior Day High");
TimeFrameSet(inDaily);
SinceSunday = BarsSince(DayOfWeek() == 0);
SundayClose = ValueWhen(DayOfWeek() == 0, C, 1);
Shift = DayOfWeek() == 1 AND sinceSunday > 0 AND SundayClose > 0;
Fshft = IIf(Shift = 1,  -1 , 0 );
DlyHgh = H;
//restore time frame
TimeFrameRestore(inDaily);
_SECTION_END();
Plot(Ref(TimeFrameExpand(DlyHgh, inDaily), Fshft), "Daily High",
colorBlue, styleLine);


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

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

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