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

Re: [EquisMetaStock Group] Re: Plotting weekly data on daily price



PureBytes Links

Trading Reference Links

Hi Vinit

> U had been of much help in plotting the weekly 3 day sma on daily
> prices. NOw that ive done that and it is working beautifully for me,
> I tried copying the same on the lower time frma. viz 3 day sma of
> high low on intraday charts. UNfortunately it is not so simple i
> relaise. Have u done any work on this earlier.
>
> Would be much obliged if u could help.
>
> regards
> Vinit

The current state of daily SMA for intraday charts is as below. Please not that the 'F' variable
must be defined to match the particular intraday charts you are using before display options '0' and
'1' will work exactly as intended. If you can't decide how to code 'F' then leave it set at zero.

If you switch to daily periodicy then these indicators will plot a standard SMA - the 'I' variable
is used to detect if a chart is daily or intraday periodicy.

These indicators could be merged into one but that would make them less flexible for use in
explorations, experts and the like.

Hope this helps.

Roy

  {Daily SMA - High}
  {Copyright© 2003-2004 Roy Larsen}
  {rlarsen@xxxxxxxxxxxxxx}
  {for use on intraday charts}
  {set 'F' to signal last bar of day}
N:=Input("Daily SMA - High, Periods",1,999,3);
Q:=Input("Display Mode,  0=Static  1=Dynamic  2=Test",0,2,2);
  {0=Display, update on last bar when possible}
  {1=Display, update on each new bar}
  {2=Backtest, update on first bar of new day}
I:=LastValue(Highest(Sum(DayOfWeek()<>
   ValueWhen(2,1,DayOfWeek()),5))=5);
M:=I OR DayOfMonth()<>ValueWhen(2-I,1,DayOfMonth());
F:=0; {Hour()=16 AND Minute()=00;}
A:=LastValue(Cum(1)-1)=Cum(1);
B:=LastValue(Cum(1))=Cum(1);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+Q>1,1,(B=0)*J);
J:=If(I,1,If(Q=2 OR Cum(J)<=1,M*2,J));
K:=HighestSince(1,M,H);
K:=ValueWhen(1,J,If(J=1,K,ValueWhen(2-I,1,K)));
K:=ValueWhen(1,K>0,K);
X:=Cum((J>0)*K);
Z:=(X-ValueWhen(N+1,J,X))/N;
Z;


  {Daily SMA - Close}
  {Copyright© 2003-2004 Roy Larsen}
  {rlarsen@xxxxxxxxxxxxxx}
  {for use on intraday charts}
  {set 'F' to signal last bar of day}
N:=Input("Daily SMA - Close, Periods",1,999,3);
Q:=Input("Display Mode,  0=Static  1=Dynamic  2=Test",0,2,2);
  {0=Display, update on last bar when possible}
  {1=Display, update on each new bar}
  {2=Backtest, update on first bar of new day}
I:=LastValue(Highest(Sum(DayOfWeek()<>
   ValueWhen(2,1,DayOfWeek()),5))=5);
M:=I OR DayOfMonth()<>ValueWhen(2-I,1,DayOfMonth());
F:=0; {Hour()=16 AND Minute()=00;}
A:=LastValue(Cum(1)-1)=Cum(1);
B:=LastValue(Cum(1))=Cum(1);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+Q>1,1,(B=0)*J);
J:=If(I,1,If(Q=2 OR Cum(J)<=1,M*2,J));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-I,1,C)));
K:=ValueWhen(1,K>0,K);
X:=Cum((J>0)*K);
Z:=(X-ValueWhen(N+1,J,X))/N;
Z;


  {Daily SMA - Low}
  {Copyright© 2003-2004 Roy Larsen}
  {rlarsen@xxxxxxxxxxxxxx}
  {for use on intraday charts}
  {set 'F' to signal last bar of day}
N:=Input("Daily SMA - Low, Periods",1,999,3);
Q:=Input("Display Mode,  0=Static  1=Dynamic  2=Test",0,2,2);
  {0=Display, update on last bar when possible}
  {1=Display, update on each new bar}
  {2=Backtest, update on first bar of new day}
I:=LastValue(Highest(Sum(DayOfWeek()<>
   ValueWhen(2,1,DayOfWeek()),5))=5);
M:=I OR DayOfMonth()<>ValueWhen(2-I,1,DayOfMonth());
F:=0; {Hour()=16 AND Minute()=00;}
A:=LastValue(Cum(1)-1)=Cum(1);
B:=LastValue(Cum(1))=Cum(1);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+Q>1,1,(B=0)*J);
J:=If(I,1,If(Q=2 OR Cum(J)<=1,M*2,J));
K:=LowestSince(1,M,L);
K:=ValueWhen(1,J,If(J=1,K,ValueWhen(2-I,1,K)));
K:=ValueWhen(1,K>0,K);
X:=Cum((J>0)*K);
Z:=(X-ValueWhen(N+1,J,X))/N;
Z;




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/BefplB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
     equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/