portfolio trader "RankStrategyR" list not clearing

Questions about MultiCharts .NET and user contributed studies.
hairyMug
Posts: 57
Joined: 03 Feb 2014
Has thanked: 5 times
Been thanked: 6 times

portfolio trader "RankStrategyR" list not clearing

Postby hairyMug » 03 Oct 2014

It seems that the "RankStrategyR" is not resetting correctly.
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 ....
1. do a "backTest"; results = 100 (example amount)
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

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: portfolio trader "RankStrategyR" list not clearing

Postby Henry MultiСharts » 06 Oct 2014

hairyMug,

Please provide the additional information that was requested via email.

hairyMug
Posts: 57
Joined: 03 Feb 2014
Has thanked: 5 times
Been thanked: 6 times

Re: portfolio trader "RankStrategyR" list not clearing

Postby hairyMug » 06 Oct 2014

Right now I don't have the time but I'll see if I can get it to you this week-end...


Return to “MultiCharts .NET”