PureBytes Links
Trading Reference Links
|
Thanks for that suggestion Mike. I have tried is both with "=" and "==".
The problem is with the rest of the code. I can only get it to shift the
entire plotted line and what I need to do is only shift Monday's plotted
line if there is trading activity on the previous Sunday. If there is
trading prior to Monday and that trading activity happens to be Sunday,
(as in futures contracts), than I need it to ignore Sunday's value's and
instead shift back to Friday.
Hope this explanation clarifies my request.
Sorry about the duplicate postings. My page wasn't sorted by date so
after the first two posts I didn't see my post at the top.
Pete :-)
--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> I can't comment on the rest of it. But, the line:
>
> Fshft = IIf(Shift = 1, -1 , 0 );
>
> should probably read:
>
> Fshft = IIf(Shift == 1, -1 , 0 ); // <-- notice ==, not =
>
>
> Mike
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Pete" dryheat3@ wrote:
> >
> > 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/
|