Newbie to ThinkScript, not to programming, I've begun learning the basics and when I create a custom scan as follows
It works great. Now, I try to define the arithmetic portion as follows
That ALSO works ok (in that it doesn't show any errors)
BUT, when I combine the two, as follows
The second line turns totally red (=> error). If I replace the second line with the original math statement as shown above, it ALSO goes red. That is, the second line in this code shows red and I get a statement saying invalid statement 2:1
So, either line is ok by itself but together they don't work
I don't get it. Any suggestions?
Thanks
Code:
((close[3] - open) / close[3]) > .2
It works great. Now, I try to define the arithmetic portion as follows
Code:
def xclose = (close[3] - open) / close[3]
That ALSO works ok (in that it doesn't show any errors)
BUT, when I combine the two, as follows
Code:
def xclose = (close[3] - open) / close[3];
xclose > .2
The second line turns totally red (=> error). If I replace the second line with the original math statement as shown above, it ALSO goes red. That is, the second line in this code shows red and I get a statement saying invalid statement 2:1
Code:
def xclose = (close[3] - open) / close[3];
(close[3] - open) / close[3] > .2
So, either line is ok by itself but together they don't work
I don't get it. Any suggestions?
Thanks