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

need help with EL and data2



PureBytes Links

Trading Reference Links

     Could someone  please help me see why the values for the moving average
for data2 in the ShowMe are different than the values on the indicator
plotted in data2.

Any help would really be appreciated.

Barry

Facts:
1- data1 is 1 minute QQQ
2- data2 is 5 minute QQQ
3- When I insert Showme on data1, the tab called "data" is set to
             "Base Study on"  data1, and   "Subgraph" selected is one.

4- the indicator is plotted on data2
     (A) the tab called "data" is set to
               "Base Study on"  data2, and   "Subgraph" selected is two
     (B)  the inputs are definitely the same as called for in the ShowMe.


Logic:
1-  if the two following conditions are true, place a dot on the high of
data1
     A)  close is greater than open on data1
     B)  close is greater than MA on data2


Example of problem:
1-  on 12:15 EST on 11/15/01 the MA on the indicator is 39.56 and the MA on
the ShowMe is 39.52


NOTE:
If I change the FORMAT tab called "data" of the SHOWME  to  "Base Study on"
data2, I can get the MA to agree, but then condition1, which is based on the
close versus open on data1 will not be correct.


The code is as follows:

inputs:
            timepd1( 0930 ),
            timepd2( 1130 ),
            timepd3( 1330 ),
            timepd4( 1600 ),
            MALength( 20 ) ;

variable:
            BuySig( 0 ),
            SellSig( 0 ),
            OK2Trade( false ),
            MA2( 0 ),
            Price2( 0 ) ;

Price2 = Close data2 ;
MA2 = AverageFC( Price2, MALength );

if time  >= timepd1 and time  <= timepd4 then
            OK2trade = true
else OK2trade = false ;

  {Calculate Data1}

Condition1 = Close > Open ;

Condition2 = Price2 > MA2;

if OK2trade and Condition1 and condition2 then
            Plot1(High,"NRBar");

Print( Date, Time, "  ", "MA2", MA2 ) ;