|
ivanf
2017-07-15 21:55:06
|
|
HI All,
I'm developing a simple strategy which ranks on sharpe and re balances monthly
here is some of the code
+++++++++++++++
rank1 = comp(sharpe(close,period), "rank"); // We optimized here the sharpe period
SetSimLongRank(-rank1);
buy = 1;
sell = month() != ref(month(),-1);
++++++++++++++
In the simulator this appears to work , however when I use the strat in a portfolio, after filling the initial 5 positions, when I run a get signals update, it immediately wants to sell these 5 and buy
the next 5 even though the month hasn't changed ( in fact the day is still the same)
If I change the -1 to just 1 , then the portfolio seems to behave itself, but the simulator shows its not buying on the first trading day of the new month , but a couple of trading days into the new month
Just wondering if I'm doing something obviously wrong to make the portfolio want to keep buying and selling the top 10 stocks ( its a 5 posn strat) everytime I hit the get signals button
thanks
Ivan
|
|