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

Re: [EquisMetaStock Group] Can experts refer to charts of different periodicity?



PureBytes Links

Trading Reference Links

Brendan


> In an intraday expert, how can I refer to todays and yesterday's
> open, high and low?
> If I use the security() function to refer to a daily security, MS
> complains about "no security with a compatible periodicity".
> My trading system relies on time of day, which is why I need the
> expert to be attached to an intraday security.
>
> Has anyone tried something similar before?
>
> TIA,

I created this for another forum a day or two ago. It was intended
specifically for hourly charts but should be adaptable to other periodises
with minor changes to the 'A' and 'B' variables. This is not the only
approach to take but the principle is solid.

The 'J' variable will have a value of "1" when the normal last hourly bar is
seen, and a value of "2" when a shortened session means then end-of-day is
not detected until the first bar of the next day. The same principle is
useful to create weekly signals on daily charts where the likelihood of
shortened trading weeks is probably greater.

Adjust the 'A' variable to identify your last bar for each day, regardless
of the periodicy.

None of this code has been fully tested for accuracy or function so do not
assume it is 100% correct. I have deliberately left out code for the OPEN of
the previous day because I have a bug with that and know it does not relate
properly to the following formulas.

Roy

  {Previous Days High}
  {use on hourly charts}
A:=Hour()=17; {set value of last hourly bar}
B:=Hour()<ValueWhen(2,1,Hour()) OR Cum(1)=2;
J:=If(A,1,If(Alert(A,2)=0 AND B,2,0));
K:=ValueWhen(1,A,HighestSince(1,B,H));
M:=ValueWhen(1,B,HighestSince(2,Alert(B>0,2),Ref(H,-1)));
ValueWhen(1,J>0,If(J=1,K,M));

  {Previous Days Low}
  {use on hourly charts}
A:=Hour()=17; {set value of last hourly bar}
B:=Hour()<ValueWhen(2,1,Hour()) OR Cum(1)=2;
J:=If(A,1,If(Alert(A,2)=0 AND B,2,0));
K:=ValueWhen(1,A,LowestSince(1,B,L));
M:=ValueWhen(1,B,LowestSince(2,Alert(B>0,2),Ref(L,-1)));
ValueWhen(1,J>0,If(J=1,K,M));

  {Previous Days Close}
  {use on hourly charts}
A:=Hour()=17; {set value of last hourly bar}
B:=Hour()<ValueWhen(2,1,Hour());
J:=If(A,1,If(Alert(A,2)=0 AND B,2,0));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2,1,C)));
K;



------------------------ 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/sO0ANB/LIdGAA/ySSFAA/BefplB/TM
---------------------------------------------------------------------~->

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/