Click here to Login

Trading Software Trading objects Features How-to Blog Search


                                                   Parse Error in Back Testing

  0

0
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");



QuantShare
2010-07-21 07:08:53

  0

Best Answer
Hi,

The problem is in the chande_trendscore_SPY. We will fix this issue in the next release.

In the meantime here is a simple fix:

VectorD vect = cFunctions.CompileFormula(.....
for(int i=0;i<result.Length;i++)
{
result[i] = vect[i];
}




Stefan Kroscen
2010-07-23 15:51:16

  0

Thanks, that works!


No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Standard Error Bands
Price Channel Position
Stock repurchase plans (Buybacks)
Horizontal Line - Changes by Value and Percentage
Historical Earnings Calendar Data for U.S. Stocks - Date/Time and...

How-to Lessons
How to debug a downloader
How to plot news on a chart?
How to create a chart with a black background
How to import trading data from CSV files
How to add trades from one portfolio to another one

Related Forum Threads
Back testing watch list
Back testing -
Error Graph should automatically scale
Error in formula
Error in formula

Blog Posts
Looking for trading ideas
How to search for a download item
Download Trading Data using the Pre-Script
Stock Market Prediction
Automatically create historical quotes charts









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2012 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items