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 [email protected], "Mike" <[EMAIL PROTECTED]> 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 [email protected], "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); > > >
