I try to implement a flexible position sizing method in an EOD system and couldn't find anything related in the forum, so I created this new topic. To calculate the position size for every new position I use the formula below:
maxPos = 10; possize_periodsshort =21; possize_periodsmid = 126; possize_periodslong = 252; maxPercentage = IIF(ROC(c, possize_periodsshort)>0,100/3,0) + IIF(ROC(c, possize_periodsmid)>0,100/3,0) + IIF(ROC(c, possize_periodslong)>0,100/3,0); SetPositionSize(maxPercentage/maxPos,spsPercentOfEquity);
Unfortunately, I’ve the bad feeling, that the system snoops into the future and set the position size based on the trade and not on the signal period. So I changed the formula using Ref().
maxPercentage = IIF(Ref(ROC(c, possize_periodsshort),-1)>0,100/3,0) + IIF(Ref(ROC(c, possize_periodsmid),-1)>0,100/3,0) + IIF(Ref(ROC(c, possize_periodslong),-1)>0,100/3,0);
The results drop significantly.
I would appreciate your expertise on whether my suspicions regarding snooping are correct or not. Any other hints are always welcome.