DavidBodhi
New member
I am very new to thinkscript and am just trying things to get familiar with the syntax.
I wrote the following code to show where a bar closing below an EMA(9) is followed by a bar closing above the EMA(9).
*****************************************************
declare lower;
def condition =
close >= ExpAverage(close,9)
and close[1] < ExpAverage(close,9)[1]
;
plot ThisThing = condition;
*****************************************************
It runs OK but it also fails to show some places where condition is true and shows the condition as true sometimes when it is not.
Anyone have any feedback for me as to why that might be the case?
Thanks
I wrote the following code to show where a bar closing below an EMA(9) is followed by a bar closing above the EMA(9).
*****************************************************
declare lower;
def condition =
close >= ExpAverage(close,9)
and close[1] < ExpAverage(close,9)[1]
;
plot ThisThing = condition;
*****************************************************
It runs OK but it also fails to show some places where condition is true and shows the condition as true sometimes when it is not.
Anyone have any feedback for me as to why that might be the case?
Thanks