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

Re : EL bug? No.



PureBytes Links

Trading Reference Links

Dans un courrier daté du 11/07/98 12:36:59  ,  Robert Pisani écrit :

<< 
 Create an intraday chart with a data1 and a data2 and run the following
 simple ShowMe.  Look at the PrintLog.  You will see that value1 does not
 equal value2.  Does anyone know why?
 
 Input:	P2 (c data2), Length(20);
 value1=Average(P2, Length) ;
 value2=Average(c data2, Length);
 print("Average:  ",value1 ,value2 );
 
 if 1=2 then plot1(0, "plot");
 
Inputs are not tied to the related data serie, or at least to the variable
that you use (here value1).
So you must modify the code to tell that you want to calculate.
The code below produces similar values in the print log window.

Input:	P2 (c data2), Length(20);
value1=Average(P2, Length) of data2;       <========
value2=Average(c data2, Length);
print("Average:  ",value1 ,value2 );

if 1=2 then plot1(0, "plot");

If my previous remak was not the correct explanation of the proble (sorry, I
have not tried), it remains valid for some other cases.
Avoiding a calculation in the print statement is a good thing to forget.

Now, if you want a better solution, you may try this one that works as you
expect.

Input:	P2 (c),num(2), Length(20);
value1=Average(P2, Length) of data(num);
value2=Average(c data2, Length);
print("Average:  ",value1 ,value2 );

if 1=2 then plot1(0, "plot");

You may remark that I use a diferent input (num) to declare the number of the
related dataserie, and that I use it to make the  variable tied to the
considered data(num) serie.

This feature has been explained in an old TS EXPRESS issue.
(Bill Brower, Editor 1000mileman@xxxxxxxxxxxxx).

Hope again this helps (this one has been verified).

Sincerely,

PierreOrphelin
www.sitrade.com

Sirtrade98 and the Assistant for Expert Traders version 2 coming soon...
Professional Market Profile  for TradeStation still available.
Our products are 32 bits & yk2 compliant.