I use the following code to set my rank:
Code: Select all
...
int lb = m_dirMVal.LowestBar(dirMLen*2);
int hb = m_dirMVal.HighestBar(dirMLen*2);
lastShort = lb [b]<[/b] hb;
lastLong = hb [b]<[/b] lb;
if (!lastLong && !lastShort)
MyPortfolioData["RankStrategyR"] = m_dirMVal.Value;
else
{
if (lastLong)
MyPortfolioData["RankStrategyR"] = m_dirMVal.Value*.98;
if (lastShort)
MyPortfolioData["RankStrategyR"] = m_dirMVal.Value*1.02;
}
.... buy & sell signals ....
2. switch "<" to ">" to change the ranking
3. do a "backTest"; results = 150
4. save the portfolio
5. exit & restart Portfolio trader
6. load portfolio saved in step 4
7. do a back test; results do not = 150 (step 3)
8. switch ">" to "<" to change the ranking back to the original code
9. do a back test; results do not = 100 (step 1)
10. save the portfolio
11. exit & restart Portfolio trader
12. do a "backTest"; results = 100
This with a list 50 stocks @ 5 minute intervals for 20 days back
Also, I noticed that many times I needed to "recompile" more than once in order for the strategy to turn Green in the tree... (this is with portfolio trader open)
Let me know if you need more info.
Walt
OS: windows 7 pro; I7 processor 16 gig ram & SSDs