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

RE: Lee_Swing



PureBytes Links

Trading Reference Links

Hello Gerald,
	At the very end, add "Swing_Lee = Return;"

Trey

-----Original Message-----
From: Gerald Marisch [mailto:gm@xxxxxxxxxxxxx] 
Sent: Friday, August 19, 2005 9:40 AM
To: Omega Chat
Subject: Lee_Swing



Below is the text, from a recent O list post, that I cut-and-pasted for
a
Function:

 Input:     NDays(NumericSimple);
 Vars:        HBar(0),                LBar(0),
                MinInt(IntPortion(NDays/5+1)),
                Direct(0),            Return(0);

 If NDays<>0 and CurrentBar>NDays then begin
    Value2=H;HBar=0;
    For Value1=1 to AbsValue(NDays)-1 begin
        If H[Value1]>Value2 then begin
            HBar=Value1;Value2=H[HBar];
        End;
    End;          Value2=L;LBar=0;
    For Value1=1 to AbsValue(NDays)-1 begin
        If L[Value1]<Value2 then begin
            LBar=Value1;Value2=L[LBar];
       End;

	    If Direct=0 then begin
        Direct=HBar-LBar;
    End;

   If Direct>0 then
        Return=Return+1
    else
        Return=Return-1;

    If LBar<HBar and Direct>0 {and HBar-LBar>MinInt} then    begin
        Direct=-1;
        Return=-HBar;
    End
    Else If HBar<LBar and Direct<0 {and LBar-HBar>MinInt}  then    begin
        Direct=+1;
        Return=LBar;
    End;

 End;
  end;

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

When verifying the Function to use with the E Mini and "big" SP, a
"grammar
error" window,
" A value was never assigned to user function", is returned.

Any one suggest what I am missing ?

Gerald Marisch