Click here to Login

Trading Software Trading objects Features How-to Blog Search


                                                   Output window problem

  0

0
F Mazandarany
2010-12-09 11:44:41


I'm starting a new tag to report my continuing problem with the Output window when running the Simulator. With your generous help I have a strategy using MM working properly. It has a script to send daily ROC to the output window. The problem is that the starting date in the output window has nothing to do do with the starting date selected in the strategy. I have two pictures(SPY and SPY-1) using the same strategy withe two entirely different starting dates as you can see from the trades on the corresponding Simulator reports( 1/1/2000, and 1/1/2003), but the Output window starts with the same date(2/27/2006). All dates after 2/26/2006 return the correct starting dates on the Output window. This may be because the Output window can't handle more bars, or perhaps it has something to do with the short Feburary month in 2006. All selected dates prior to 2/27/2006 return the same starting date:2/27/2006 in the Output window. This obviously has nothing to do with clearing the output window prior to executing a new strtegy. I have been doing that in all cases! I'm reproducing the Strategy Script for you to test.
First, here is the picture upload URL:
http://img202.imageshack.us/i/spy1u.jpg/
http://img593.imageshack.us/i/spyu.jpg/

The script follows;

string symbolLong = "spy";
string symbolShort = "SPY";
string rule1 = "a = close > sma(200)*1.035;";
string rule2 = "a = close < sma(200)*0.965;";
TimeSeries buy = Data.ParseFormula(rule1).GetTimeSeries(symbolLong, "a");
TimeSeries sell = Data.ParseFormula(rule2).GetTimeSeries(symbolLong, "a");

if(buy[0] > 0)
{
if(!Portfolio.IsInPortfolio(symbolLong, true))
{
Functions.CloseAllPositions(0);
Portfolio.UpdateCategorySettings("short", 0, 1, null);
Portfolio.UpdateCategorySettings("long", 100, 1, null);

Functions.AddLongPosition(symbolLong, null);
}
}
else if(sell[0] > 0)
{
if(!Portfolio.IsInPortfolio(symbolShort, false))
{
Functions.CloseAllPositions(0);
Portfolio.UpdateCategorySettings("long", 0, 1, null);
Portfolio.UpdateCategorySettings("short", 100, 1, null);

Functions.AddShortPosition(symbolShort, null);
}
}
if(Variables.IsVariableExists("equity"))
{
double equity = (double)Variables.GetVariable("equity");
double roc = Math.Round(((Portfolio.Equity / equity) - 1) * 100, 4);
Global.Trace(Divers.CurrentDate.ToString() + (char)Keys.Tab + roc);
}

Variables.SetVariable("equity", Portfolio.Equity);



QuantShare
2010-12-09 14:13:46

  0

- Yes you are right, there is a limit in the number of lines the output window can display. We will increase this limit.

- Another solution is to add the following code:

if(Variables.IsVariableExists("equity"))
{
double equity = (double)Variables.GetVariable("equity");
double roc = Math.Round(((Portfolio.Equity / equity) - 1) * 100, 4);
string text = Divers.CurrentDate.ToString() + (char)Keys.Tab + roc;
Variables.SetVariable("output", Variables.GetVariable("output") + Environment.NewLine + text);
}
else
{
Variables.SetVariable("output", "");
}

Variables.SetVariable("equity", Portfolio.Equity);

- And the following line in the "OnEndSimulation" event:
System.IO.File.WriteAllText("c:\\output.txt", (string)Variables.GetVariable("output"));

This will save the data in a file: c:\output.txt

- Don't forget to remove the old code:

if(Variables.IsVariableExists("equity"))
{
double equity = (double)Variables.GetVariable("equity");
double roc = Math.Round(((Portfolio.Equity / equity) - 1) * 100, 4);
Global.Trace(Divers.CurrentDate.ToString() + (char)Keys.Tab + roc);
}

Variables.SetVariable("equity", Portfolio.Equity);




F Mazandarany
2010-12-10 11:26:14

  0

Thank you; this works well. When would you be increasing the output window look back limit? I would like to see the equivalent of at least 10 years/4000 days.Thanks again.


QuantShare
2010-12-10 11:40:59

  0

In the next release (2 weeks)



QuantShare
2011-01-05 05:35:13

  0

Best Answer
We increased the output form buffer limit in version 2.1.2



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
Output metric for each trading year
Per Symbol Average Output
Average Output Per Month
Average Output Per Year
ISEE Index - ISE Sentiment Index

How-to Lessons
How to debug a trading system using the money management tool
How to perform a basic quantitative analysis using the S&P 500
How to rename a ticker symbol
How to scale and move the chart Y-axis
How to create and trade a Neural Network model

Related Forum Threads
problem with nse data
UPDATE PROBLEM
Problem with "Save Trading System" in Optimizer
A Little Problem in New Version
Intraday Settings config window data entry problems.

Blog Posts
Optimization of trading rules
Compare stocks and securities by creating a relative performance ...
New Ranking and Percentile Composite Functions
Stock Market Prediction
How to create a market timing system









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