Hello
Issue with percentage change. The idea is following:
“The precentage change today should be equal to the highest percenage change in 2 days. Measured close to close.”
I am trying to use the simplified creation as far as I can and then supplement the strategy manually in the end. With Variation I have added following (c7):
// Conditions to enter short positions
c4 = (close[1] > close[2])
c5 = (close > close[1])
indicator4 = Average[200](close)
c6 = (close < indicator4)
indicator5 = Variation(close)
c7 = (indicator5 = indicator5[2])
So question is how do I rewrite the code so its equal to the highest percenage change in 2 days (close to close)?
As it is right now, checks only 2 days ago. Maybe its even possible to do it with simplified creation?
if your 2 days variations are “yesterday to today” and “day before yesterday to yesterday” then you’d want:
c7 = indicator5>=indicator5[1]
Thanks for your answer.
Would I be able to write the code like this:
c9 = variation(close) >= (variation(close[1]) and variation(close[2]))
So, variation today is equal or higher than (the variation yesterday and the day before yesterday)?
No, you need to type 2 times the condition:
c9 = (variation(close) >= variation(close[1])) AND (variation(close) >= variation(close[2]))
Thanks and appologies for my “beginner” questions… 🙂