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

Re: value question 3



PureBytes Links

Trading Reference Links

Put the code in an indicator and open the data window and see what the
actual values of value2 are.  Recode the statement if TS doesn't like
it.  I wouldn't code it that way in TS2ki but I'm not a big time
coder.

if condition1 and value2>value2[1] then...

Jimmy


Expressing my question another way. I have added the example once more. Let 
me try once more.
Sorry for the mistake. If you forget about condition1 and just use condition 
2,  TS. does not recognize condition2 . The addition of the linear 
regression makes no difference. I don't want it
to print if the LR is pointing down. Why does this not work?  condition2 =   
value1 > 30 and value2 > value2[1] ;???  it prints the same wheather the lr 
is added or not.
   if condition1 and condition2 then begin, this does not work either.
it prints the same as condition1. The bottom line,  the arctangent function 
does not want to
cooperate. or does something have to be added? or written differently? you 
would haveto put this on a chart to see it.
  the code below is just a raw example to use for simplicity. scratch 
condition 1, condition 2 does not work. be sure to change the if statement 
to condition2.




input:  Price(Average(c,20)), NumBars(1), length1(3);
vars: s(0);
value1 = (arctangent((Price-Price[NumBars])/NumBars));
value2 = (LinearRegValueFC(Price, Length1, 0));

condition1 = value1 > 30;
condition2 =   value1 > 30 and value2 > value2[1] ;
if condition1 then begin
S = TEXT_NEW(DATE,TIME,HIGH-3,"30");
end;