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

Re: Multi data EL ?


  • To: Ian Cunningham <CunCom@xxxxxxxxxxxxxx>
  • Subject: Re: Multi data EL ?
  • From: VISTA Research and Trading <skt@xxxxxxxxx>
  • Date: Sat, 3 Oct 1998 03:08:47 -0400 (EDT)
  • In-reply-to: <3.0.1.32.19980930175619.006d07d8@xxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

At 05:56 PM 09/30/98 -0400, you wrote:
>>Date: Wed, 30 Sep 1998 15:03:31 -0400
>>To: "INTERNET:omega-list@xxxxxxxxxx" <omega-list@xxxxxxxxxx>
>>From: Ian Cunningham <CunCom@xxxxxxxxxxxxxx>
>>Sender: Ian Cunningham <CunCom@xxxxxxxxxxxxxx>
>>Subject: Multi data EL ?
>>
>>
>>I am attempting to verify a multi-data system and running into a problem.
>>A True/False variable, BOK,  is used as a Buy setup.  When I try to  verify:
>>        If BOK of Data2 then begin
>>
>>I get a "The word THEN must follow an if condition" message with 'Data2'
highlighted.
>>
>>Would someone kindly point out my mistake?
>>TIA, Ian.
>>

Since BOK is a variable, which stores a user assigned value, it's value can
not be modified by a data identifier.  A "User Function", or a "Built-In
Function", may be so modified.  For the record, you can say :

Vars  : BOK.d2  (00, Data2) ;

which will ensure that the variable is incremented, as far as the
MaxBarsBack buffer is concerned, on the close of each bar of Data2.

Inputs: FastLen       (14),
        SlowLen       (28) ;

Vars  : FastMA (00, Data2),
        SlowMA (00, Data2) ;


FastMA = Average (Close, FastLen) of Data2 ;
SlowMA = Average (Close, SlowLen) of Data2 ;

if  FastMA [00]  > SlowMA [00] and
    FastMA [01] <= SlowMA [01]
then begin
 { ... }
end ;

	Now the "[01]" modifier ensures that we are looking back one bar of DATA#2
rather than one bar of Data#1.

	I have included teh code for a couple of studies below...

Samuel


{
Type : Study
Name : _Multi Data Chart
Notes: 

Input: 
Alert: 
Calls: 
Uses : 

EasyLanguage interpretation provided
   by  Samuel K. Tennis
   of  VISTA Research and Trading, Inc. (c) 1998.
  Any unauthorized use of this material may constitute a
  violation of U.S. and International Copyright Laws.
}


Inputs: Fast.Len  (10),
        Slow.Len  (20) ;

Vars  : Fast.Ma1  (00),
        Slow.Ma1  (00),
        Fast.Ma2  (00, Data2),
        Slow.Ma2  (00, Data2) ;
Vars  : cPrice1   (Close),
        cPrice2   (Close, Data2) ;

cPrice1 = (High + Low + Close) of Data1 / 03 ;
cPrice2 = (High + Low + Close) of Data2 / 03 ;

Fast.Ma1 = Average (cPrice1, Fast.Len) of Data1 ;
Slow.Ma1 = Average (cPrice1, Slow.Len) of Data1 ;

Fast.Ma2 = Average (cPrice2, Fast.Len) of Data2 ;
Slow.Ma2 = Average (cPrice2, Slow.Len) of Data2 ;

Plot1 (Fast.MA1, "Fast.MA1") ;
Plot2 (Slow.MA1, "Slow.MA1") ;
Plot3 (Fast.MA2, "Fast.MA1") ;
Plot4 (Slow.MA2, "Slow.MA1") ;

{
Custom Programming Services provided by:

               Samuel K. Tennis
       VISTA Research and Trading, Inc.
        8103 Camino Real, Suite C-409
            South Miami, FL 33143
           voice : 1(305) 273-1321
           fax   : 1(305) 273-9164
           eMail :  skt@xxxxxxxxx
             http://www.vista.com/
}





{
Type : Study
Name : _Multi Data Chart #2
Notes: 

Input: 
Alert: 
Calls: 
Uses : 

EasyLanguage interpretation provided
   by  Samuel K. Tennis
   of  VISTA Research and Trading, Inc. (c) 1998.
  Any unauthorized use of this material may constitute a
  violation of U.S. and International Copyright Laws.
}


Inputs: Fast.Len  (10),
        Slow.Len  (20) ;

Vars  : Fast.Ma1  (00,    Data1),
        Slow.Ma1  (00,    Data1),
        Fast.Ma2  (00,    Data2),
        Slow.Ma2  (00,    Data2) ;
Vars  : HiHi.2    (00,    Data2),
        LoLo.2    (00,    Data2) ;
Vars  : cPrice1   (Close, Data1),
        cPrice2   (Close, Data2) ;


{*
if  skt.Print.Headers ("George")  then ;
if Time of Data1 = Time of Data2 then ;
if Data of Data1 = Date of Data2 then ;
 *}
if  Time of Data1 = Time of Data2 then begin
  HiHi.2 = High of Data2 ;
  LoLo.2 =  Low of Data2 ;
end ;

cPrice1 = (High + Low + Close) of Data1 / 03 ;
cPrice2 = (High + Low + Close) of Data2 / 03 ;

Fast.Ma1 = Average (cPrice1, Fast.Len) of Data1 ;
Slow.Ma1 = Average (cPrice1, Slow.Len) of Data1 ;

Fast.Ma2 = Average (cPrice2, Fast.Len) of Data2 ;
Slow.Ma2 = Average (cPrice2, Slow.Len) of Data2 ;

Plot1 (HiHi.2, "HiHi.2") ;
Plot2 (LoLo.2, "LoLo.2") ;

{*
Plot1 (Fast.MA1, "Fast.MA1") ;
Plot2 (Slow.MA1, "Slow.MA1") ;
Plot3 (Fast.MA2, "Fast.MA1") ;
Plot4 (Slow.MA2, "Slow.MA1") ;
 *}

{
Custom Programming Services provided by:

               Samuel K. Tennis
       VISTA Research and Trading, Inc.
        8103 Camino Real, Suite C-409
            South Miami, FL 33143
           voice : 1(305) 273-1321
           fax   : 1(305) 273-9164
           eMail :  skt@xxxxxxxxx
             http://www.vista.com/
}




{
Type : Study
Name : __Multi Data Stops1
Notes: 
}

Inputs: Price   (Close),
        HiHiLen    (08),        LoLoLen    (08) ;
Vars  : Trend      (00) ;


Value2 = Highest (High, HiHiLen) of Data2 ;
Value3 =  Lowest ( Low, LoLoLen) of Data2 ;

if  BarNumber <= 01  then begin
  Value12 = Value2 ;
  Value13 = Value3 ;
end ;

if  High   > Value12  then begin
  Trend   =    +01 ;
  Value12 = Value2 ;
end ;

if   Low <   Value13  then begin
  Trend   =    -01 ;
  Value13 = Value3 ;
end ;

If Trend <= 00 and Value2 <  Value12 
  then Value12  = Value2 ;

If Trend >= 00 and Value3  > Value13 
  then Value13  = Value3 ;

{* Use FALSE to remove two plots w/o having to re-add study to chart *}
{*
If False Then begin
  Plot1 (Value2,  "Wkly  Buy") ;
  Plot2 (Value3,  "Wkly Sell") ;
End ; 
 *}

if Trend <=  00 then Plot3 (Value12, "Trnd Buy") ;
if Trend >=  00 then Plot4 (Value13, "TrndSell") ;

{
Custom Programming Services provided by:

               Samuel K. Tennis
       VISTA Research and Trading, Inc.
        8103 Camino Real, Suite C-409
         South Miami, Florida  33143
           voice : 1(305) 273-1321
           fax   : 1(305) 273-9164
           eMail :  skt@xxxxxxxxx
             http://www.vista.com
}

    Samuel K. Tennis      VISTA Research and Trading, Inc.
    8103 Camino Real C-409          voice: 1(305) 273-1321
    S. Miami, FL  33143               fax: 1(305) 273-9164
    skt@xxxxxxxxx                    http://www.vista.com/
           ***** Easy Language Spoken Here *****