Page 1 of 1

Chart Script Code

Posted: Sun Jul 05, 2015 7:03 pm
by dan2fl
Hi,
I am trying to code:
"Yesterdays Close is less than the High of two days ago"
I thought it rather simple and wrote
Cond1:= C,1 < H,2; but that does not work.
I then tried
Cond1:=REF (C,1) < REF ( H,2);
still with no success.
Does anyone have a suggestion?
Thanks,
Dan

Re: Chart Script Code

Posted: Mon Jul 06, 2015 2:07 pm
by Chris White
You have the correct syntax in your second attempt, but no output would be shown on the chart or available in a template because you used := instead of just :

:= means calculate and assign the result to the named variable
: means calculate and assign the result to the named variable and make it an output.

Here's the correct code (i used event as the named variable in this case):

Code: Select all

event: REF(C, 1) < REF(H,2);