|
Stefan Kroscen
2010-07-20 21:45:57
|
|
I am getting parse errors when backtesting. I've spent the evening trying to resolve them, and at present I do not think this is my code as I have
tried commenting out some of the rules and re-adding them. At times they work, at other times they don't. It does not seem to be consistent.
Is there any way to further troubleshoot what is happening here?
Appreciate any help you can provide!
The trading rules are:
// Buy rules
Rule1 = chande_trendscore_SPY() >= 10;
Rule2 = sma(ChannelPosition(close,200),6) <= 0.2;
buy = (Rule1) && (Rule2);
// Sell rules
Rule3 = chande_trendscore_SPY() <= 0.0;
Rule4 = sma(ChannelPosition(close,200),6) >= 0.8;
sell = (Rule3) || (Rule4);
--------------------------------------------
chande_trendscore_SPY:
result = cFunctions.CompileFormula("b=GetSeries('SPY', close); a = iff(b>=Ref(b,11),1,-1)+iff(b>=Ref(b,12),1,-1)+iff(b>=Ref(b,13),1,-1)+iff(b>=Ref(b,14),1,-1)+iff(b>=Ref(b,15),1,-1)+iff(b>=Ref(b,16),1,-1)+iff(b>=Ref(b,17),1,-1)+iff(b>=Ref(b,18),1,-1)+iff(b>=Ref(b,19),1,-1)+iff(b>=Ref(b,20),1,-1);").GetVectorDouble("a");
|
|