I am trying to backtest a strategy in which x amount of SPY is bought when the annual average hits -10%. X amount is held for the duration of the year and then sold on the last day of each year for the best offer, this is repeated each year. I am having trouble thinking of a way to do this without being extremely redundant by inputting data for the beginning and end of each year.
Size:
Color:
What is "the annual average hits -10%": a -10% decline in a 252-day SMA (compared to N bars ago) or something else? Seems that you can build such system from Rules easily:
Size:
Color: