[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

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___