|
Atlanta Georgia
Posts: 2 since Jun 2014
Thanks Given: 0
Thanks Received: 2
|
To answer my own question partially:
plot ytdreturn =100* (close(period = AggregationPeriod.DAY)-close(period = AggregationPeriod.DAY)[251])/(close(period = AggregationPeriod.DAY)[251]);
That will give approximately 1 year of returns (251 business/trading days).
Similarly:
plot ytdreturn =100* (close(period = AggregationPeriod.DAY)-close(period = AggregationPeriod.DAY)[115])/(close(period = AggregationPeriod.DAY)[115]);
Since there have been 115 trading days since the beginning of this year, the above formula gives YTD % Return. I would like to figure out a way to replace the 115 with a variable since tomorrow it will be 116, day after 117 and I don't want to have to change it every day.....
|