Click here to Login





                                                   Backtest Buy Open/Sell Close Every Day

  0

0
Scott Stephens
2013-05-12 00:51:42


Hi,

I've been playing around with QuantShare trying to get the hang of it, and I haven't been able to figure out how to backtest a very simple strategy. All I want to do is buy the open and sell the close every day, for a single stock. In the strategy section I've got Long only, "Buy at open of today" with the rule just "1", and "Sell at close of today", again with the rule just "1".

When I run this, it appears that instead of buying the open and selling the close each day, I buy the open each day, and then close that position the following day. IE, it would buy the open Monday, then sell the close Tuesday, rather than buying the open Monday and selling the close that same day. What am I doing wrong?

Thanks for the help,

Scott



clonex
2013-05-12 04:24:29

  0

Best Answer
you have to put this code :

SetSimTiming(_buy,_open,0);
SetSimTiming(_sell,_Close,-1);

Clonex



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
Simple pattern detection rules using close and open prices
Buy & Hold of SPY or any Other Index/ETF on Profitable Months
Buy Falling Stocks Strategy
Backtest different Segments in your Trading System
VIX Volatility Index Statistics per Day of Week

How-to Lessons
How to plot the number of stock tweets per day
How to automatically start a downloader every few minutes?
How to display the number of stocks per day for different RSI gro...
How to set order type of a trading system programmatically
How to automate the data downloading process

Related Forum Threads
Setsimtiming -- Buy signal day open and sell signal day close
Selling according to the buy day data
Historical Daily High, Low, and Close for every single stock?
backtesting, I want to buy and sell only 1 stock for every 5 days...
Rise or Fall Percentage of a Day Close

Blog Posts
How To Create and Backtest an S&P 500 Trend Following System
How to Backtest an Intraday Stock Trading System with EOD Ranking
How to build and backtest a robust stock trading system
Trading System: Buy Stocks based on their Sharpe Ratio Rank
Day Trading: A trading system that combines intraday and EOD data









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 © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.