|
Salvatore Gaziano
2018-03-01 07:08:41
|
|
Dear community,
i created a custom historical database "nav_rettificati" where there are two column: "Date" is a date and "closeret" is a float. This database store the daily closing price adjusted with dividend/distribution for each symbol (the value for symbol doesn't make distribution is the same of daily closing price).
I can get access to this data in Simulator thorugh:
rettNav= GetData("nav_rettificati", "closeret", LastData);
Now i want use this to compare the 1 month performance of a fix benchmark to each stocks in my strategy.
In the past i used a system like this, but i calculate the performance on the close price in the Quote db.
In this context i created a New trading system strategies in Simulator where i did it.
The time frame bars is daily. I rebalance only at the end of each month.
bench = TimeframeGetSeries1("MON", 31, close, LastData);
bench = timeframecompress(bench);
bench = perf(bench, 1);
benchPerf = timeframedecompress(bench);
symPerf = timeframedecompress(timeframeapply(31, perf(close, 1)));
compare = symPerf > benchPerf;
Now i want do the same functionality, but i cant use TimeframeGetSeries1 to get apply monthly timeframe (31)
I use this instruction to get the data information for benchmark and i get daily "closeret" price for benchmark symbol "MON"
rettNav= GetData("nav_rettificati", "closeret", LastData, "MON");
But i don't understand how i can proceed to compress in monthly like this
bench = TimeframeGetSeries1("MON", 31, close, LastData);
bench = timeframecompress(bench);
bench = perf(bench, 1)
Thank you
|
|