facebook  Twitter youtube  blogger
Welcome, Guest
Username: Password: Remember me

TOPIC: Backtesting NG algo strategy - historical data bas

Backtesting NG algo strategy - historical data bas 11 months 3 weeks ago #98

  • jean1975
  • jean1975's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Thank you received: 2
  • Karma: 1
Hello Marco,

I'm starting with some basic questions about how to find the historical data to backtest an algo strategy for Natural Gas.
It will be an automated strategy based on 30 minute OHLC bars.

I'm pretty sure that for you will be absolutely easy questions :-)
Here are my doubts:

1) How are you managing contracts rollover in futures for backtesting? Are you using continuous contracts?
2) Is there any place in which you can obtain 30m bars historical data of Natural Gas and other commodities for free, like yahoo / google finance APIs?
If not, could you please make a recommendation about a preferred data source?

Thank you in advance for your help!

Best
Jean
The administrator has disabled public write access.

Backtesting NG algo strategy - historical data bas 11 months 3 weeks ago #99

  • marco
  • marco's Avatar
  • Offline
  • Moderator
  • Posts: 23
  • Thank you received: 6
  • Karma: 3
jean1975 wrote:
Hello Marco,

1) How are you managing contracts rollover in futures for backtesting? Are you using continuous contracts?
2) Is there any place in which you can obtain 30m bars historical data of Natural Gas and other commodities for free, like yahoo / google finance APIs?
If not, could you please make a recommendation about a preferred data source?

Hi Jean,

Here are my answers.

1) It depends on the strategy. I almost always use continuous contracts. Now for intraday strategies where price gaps due to rollovers don't matter I use price non adjusted contracts. For strategies where it does matter because they're based on daily charts for example or referring to daily charts I use price adjusted continuous contracts. This does work fine, just have to make sure you can deal with the adjusted price data (sometimes you'll have negative values for example).
2) Unfortunately not for free. Getting good intraday data is still a challenge even if you're ready to pay a decent amount on money. I already thought about starting my own data provider service as everything I've seen is either not as good as I'd like it to be, or lacking a decent API to get the data into the way I need it or incredibly expensive. www.tickdata.com or Nanex for example is providing high quality intraday data on a tick basis but that comes at a price. Really good intraday data that comes at a retail price is hard to find. You just need to be aware of the limitations here. My advice here is to make sure your strategy is simple and robust enough to not be vulnerable to small errors in your data. On 30 min bars this should work out fine. Then you can go with TradeStation, IQFeed, Kinetick, Trade Navigator and so forth.

Happy Trading!

Marco
Last Edit: 11 months 3 weeks ago by marco.
The administrator has disabled public write access.

Backtesting NG algo strategy - historical data bas 11 months 2 weeks ago #100

  • jean1975
  • jean1975's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Thank you received: 2
  • Karma: 1
Hello Marco,

Thanks a lot for the expert advice. For this 30 min strategy I will use not adjusted contracts.
I already have a data feed connection with IB for my discretionary trading account.
In these days the market is very thin, for a daytrader is better to stand aside and wait for higher volumes.
Therefore now I have the chance to invest some time to develop also my quant skills.

In order to retrieve the historical data I wrote some Python code which is connecting to the IB APIs.
With the connector the historical data are automatically stored in a MySQL database.

I will shortly start to code the backtesting trading strategy with numpy and pandas.
It is the first time so I will for sure come with more questions :-)

Thank you again, have a peaceful Christmas.

Best
Jean
The administrator has disabled public write access.

Backtesting NG algo strategy - historical data bas 11 months 2 weeks ago #101

  • marco
  • marco's Avatar
  • Offline
  • Moderator
  • Posts: 23
  • Thank you received: 6
  • Karma: 3
jean1975 wrote:
Hello Marco,

Thanks a lot for the expert advice. For this 30 min strategy I will use not adjusted contracts.
I already have a data feed connection with IB for my discretionary trading account.
In these days the market is very thin, for a daytrader is better to stand aside and wait for higher volumes.
Therefore now I have the chance to invest some time to develop also my quant skills.

In order to retrieve the historical data I wrote some Python code which is connecting to the IB APIs.
With the connector the historical data are automatically stored in a MySQL database.

I will shortly start to code the backtesting trading strategy with numpy and pandas.
It is the first time so I will for sure come with more questions :-)

Thank you again, have a peaceful Christmas.

Best
Jean

Hi Jean,

Sounds good! IBs historical data is not the best though...but to get started it's okay.

Happy Trading!

Marco
The administrator has disabled public write access.
Time to create page: 0.175 seconds

Derivative transactions, including futures, are complex and carry a high degree of risk. They are intended for sophisticated investors and are not suitable for everyone. There are numerous other factors related to the markets in general or to the implementation of any specific trading program which cannot be fully accounted for in the preparation of hypothetical performance results, and all of which can adversely affect actual trading results. For more information, see the Risk Disclosure Statement for Futures and Options.