Hi,
I am trying to find stocks that are up 2 of the last 3 days, starting from yesterday. If you can help me do that, you can ignore my question below.
Thanks for any help!
Scott
Question Below:
I think that I can use the Sum function for my problem. But in my testing, I was surprised to see that stocks that were up for the last 3 days (yesterday, the day before yesterday and the day before that), had values of 1, 2 or 3 when I added a column with the code below.
def priceCondition = close[1] > close[2] and close[2] > close[3] and close[3] > close[4];
plot out = Sum(priceCondition, 3);
Can anyone explain why that is?
I am trying to find stocks that are up 2 of the last 3 days, starting from yesterday. If you can help me do that, you can ignore my question below.
Thanks for any help!
Scott
Question Below:
I think that I can use the Sum function for my problem. But in my testing, I was surprised to see that stocks that were up for the last 3 days (yesterday, the day before yesterday and the day before that), had values of 1, 2 or 3 when I added a column with the code below.
def priceCondition = close[1] > close[2] and close[2] > close[3] and close[3] > close[4];
plot out = Sum(priceCondition, 3);
Can anyone explain why that is?