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

[Metastockusers] (Attn Jose) Re: Help Needed w/ENTER LONG formula



PureBytes Links

Trading Reference Links

Jose,

First of all, thank you for your insight and putting the formula in 
clear English. 

Here's what really has me puzzled.

I uploaded a chart (ATVI: NASDAQ) in the Files section that has 
the "3-Period-Range Switch" Expert attached.

Please take a look at this chart and note the circled area. I have 
placed 5 blue arrows underneath signals generated by this Expert. 
They all appear to me to be incorrect, according to what the formula 
states is an "Enter Long" or "Enter Short".

Here's the raw data for the 5 instances I have highlighted.

(03/11/2004) Enter Short: Close = 13.34 
LLV for the previous three days = 13.33 (03/08/2004) 

(03/17/2004)  Enter Long: Close = 14.01
HHV for the previous three days = 14.04 (03/16/2004)

(03/22/2004) Enter Short: Close = 13.70 
LLV for the previous three days = 13.47 (03/17/2004) 

(03/23/2004)  Enter Long: Close = 13.82
HHV for the previous three days = 14.21 (03/19/2004)

(03/24/2004) Enter Short: Close = 13.62
LLV for the previous three days = 13.38 (03/22/2004) 

I can not understand how a formula can compute incorrect values.
That to me is like a computer saying 2 +2 = 4 but once in a while the 
answer is 5.

You really seem to have strong understanding of MS formula code.
Can you figure out how or why MS is giving these Long and Short 
signals?

I hope you can shed some light on why MS is generating signals when 
the conditions for a Long or Short don't appear to have been met.

Once again I have copied the formulas exactly as they are written for 
Enter Long and Enter Short below.

Thank you for looking into this.

P.S. Please note that, originally, when I copied the code and pasted 
it in my message that I missed including the very end of the formula. 
(I didn't see it until I scrolled all the way down.)  

(Enter Long)

d:=If(C>Ref(Max(H,Max(Ref(H,-1),Ref(H,-2))),-1),Min(L,Min(Ref(L,-
1),Ref(L,-2))),If(C<Ref(Min(L,Min(Ref(L,-1),Ref(L,-2))),-1),Max(H,Max
(Ref(H,-1),Ref(H,-2))),PREV));

a:=Cross(C,d);
b:=Cross(d,C);

state:=If(BarsSince(a)<BarsSince(b),1,0);

state>Ref(state,-1)

--------------------------------------------------------------------

(Enter Short)

d:=If(C>Ref(Max(H,Max(Ref(H,-1),Ref(H,-2))),-1),Min(L,Min(Ref(L,-
1),Ref(L,-2))),If(C<Ref(Min(L,Min(Ref(L,-1),Ref(L,-2))),-1),Max(H,Max
(Ref(H,-1),Ref(H,-2))),PREV));

a:=Cross(C,d);
b:=Cross(d,C);

state:=If(BarsSince(a)<BarsSince(b),1,0);

state<Ref(state,-1)

---------------------------------------------------------------------



--- In Metastockusers@xxxxxxxxxxxxxxx, "Jose" <josesilva22@xxxx> 
wrote:
> 
> I'm surprised that "professional" MetaStock programmers are capable 
of 
> producing such crappy MS code.
> 
> Leaving the PREV() issue aside, the code can be written (and better 
> understood) this way:
> 
> ---8<--------------------------------
> d:=If(C>Ref(HHV(H,3),-1),LLV(L,3),
>  If(C<Ref(LLV(L,3),-1),HHV(H,3),PREV));
> a:=Cross(C,d);
> b:=Cross(d,C);
> a+-b
> ---8<--------------------------------
> 
> In English:
> 
> If the Close is greater than the highest High for the previous 
three 
> days, plot the lowest Low of the past three days (including today), 
> otherwise do this:
> 
> If the Close is less than the lowest Low for the previous three 
days, 
> plot the highest High of the past three days (including today), 
> otherwise plot the previous formula value.
> 
> 
> jose '-)
> http://users.bigpond.com/prominex/pegasus.htm
> 
> 
> 
> --- In Metastockusers@xxxxxxxxxxxxxxx, "Jeff" <jnickoloff6@xxxx> 
> wrote:
> > The Enter Long formula for the "3-Day_range Switch" included 
> > in "Performance Sytems Plus" plugin is as follows:
> > 
> > d:=If(C>Ref(Max(H,Max(Ref(H,-1),Ref(H,-2))),-1),Min(L,Min(Ref(L,-
> > 1),Ref(L,-2))),If(C<Ref(Min(L,Min(Ref(L,-1),Ref(L,-2))),-1),
> > Max(H,Max(Ref(H,-1),Ref(H,-2))),PREV));
> > 
> > a:=Cross(C,d);
> > b:=Cross(d,C);
> > 
> > 
> > I thought the formula above was a fancy way of simply generating 
a 
> > BUY signal if:
> > 
> > CLOSE of TODAY was GREATER THAN the MAX HIGH of the PRIOR 3 DAYS.
> > 
> > Yet, I have found numerous chart examples of the system 
generating a
> > BUY signal when:
> > 
> > CLOSE is LESS THAN the MAX HIGH of the PRIOR 3 DAYS.
> > 
> > So either I'm wrong on how this system generates BUY signal or MS 
is 
> > just so buggy that it calculates incorrectly!
> > 
> > Which is it?
> > 
> > Thank you to anyone who can give me some help with this one
> > 
> > -Jeff



------------------------ 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/zMEolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

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

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

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