NexusFi: Find Your Edge


Home Menu

 





historical data programming question


Discussion in NinjaTrader

Updated
    1. trending_up 1,382 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

historical data programming question

  #1 (permalink)
 nicanorbabula 
Torino Italy
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Broker: AMP/CQG + OEC/OEC
Trading: CL
Posts: 14 since Oct 2014
Thanks Given: 5
Thanks Received: 4

Hello everybody,

This is my first question in here, so please excuse any eventual mistakes (wrong forum, etc)...

A)
Anybody has or know where to find reliable piece of code that would:
1) construct good time-based bars from ticks?
2) construct bigger timeframe bars from 1 second bars?
I already have a piece of code that does that, but I would really love to find something more "official", or already tested...

B)
What would be the reliability of such a conversion?
Would it be better to save the already formed bars provided from the datafeed (although not very practical because there is virtually an infinite number of bars (ranges, time-based, ...)


Thank you very much!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
 
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Reponding to your B) question :

It all depends what you are trying to do...

If you have tick data and store the tick data (provided you have the space) then you can create any kind of
time based bars (and all other synthetic and derived bars). Storing tick data gives you the broadest option.

1. Is your data good tick data ? Do you need maximum flexibility ?

2. Alternatively you can decide to aggregate tick data into an acceptable time frame bar, the fundamental
difference between tick and time based, is that you will have to let go some other information, which you
might have or not...

On a tick level, you might have bid and ask price and you might have the volume at the bid and ask, if
applicable.. That information is useful in some cases, to create certain extra insight...

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 nicanorbabula 
Torino Italy
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Broker: AMP/CQG + OEC/OEC
Trading: CL
Posts: 14 since Oct 2014
Thanks Given: 5
Thanks Received: 4


rleplae View Post
Reponding to your B) question :

It all depends what you are trying to do...

If you have tick data and store the tick data (provided you have the space) then you can create any kind of
time based bars (and all other synthetic and derived bars). Storing tick data gives you the broadest option.

1. Is your data good tick data ? Do you need maximum flexibility ?

2. Alternatively you can decide to aggregate tick data into an acceptable time frame bar, the fundamental
difference between tick and time based, is that you will have to let go some other information, which you
might have or not...

On a tick level, you might have bid and ask price and you might have the volume at the bid and ask, if
applicable.. That information is useful in some cases, to create certain extra insight...

Thanks for the answer

1. How can I check if I have good tick data? I am starting from AMP's 5-year history offered along with Multicharts special edition. Is there any better affordable solution? I only need 2 years of tick history.

2. Pre-agregating it in bars doesn't feel right...

Started this thread Reply With Quote
  #5 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


nicanorbabula View Post
Thanks for the answer

1. How can I check if I have good tick data? I am starting from AMP's 5-year history offered along with Multicharts special edition. Is there any better affordable solution? I only need 2 years of tick history.

2. Pre-aggregating it in bars doesn't feel right...

Depends what you want to do ?

Give me an example of a trade setting or how you trade ?
You want to test your method / system ?

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 nicanorbabula 
Torino Italy
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Broker: AMP/CQG + OEC/OEC
Trading: CL
Posts: 14 since Oct 2014
Thanks Given: 5
Thanks Received: 4


rleplae View Post
Depends what you want to do ?

Give me an example of a trade setting or how you trade ?
You want to test your method / system ?

I am building a new platform and I need at this point to build a historical data too, otherwise it would be very counter-producting to write for MC or NT and backtest there and *then* migrate code to my platform. The backtester (trades engine) is already written, auto-trading part too. All I need is historical data.

My idea is to put all the ticks (also the best ones ) in Google BigQuery or the Google Datastore and then requesting them when backtesting. Everything would run from Amazon instances so internet speed would never be an issue.

My strategies trade futures intraday and work with 2 timeseries of the same future working all like this:
Let's imagine it goes long on green inside-bars and short on red inside-bars. It would wait for a 15 mins inside bar to close then send stop-limit order with the next tick (or the close of the first 1 sec bar after the close of the 15 min inside bar).
So:
Every strategy needs a big timeframe (like 15m, 5m, 60m for geometrical recognition purposes) and a "clock" one (tick, 1 second or at worst 5 seconds). I also trade up to 6 different symbols.

You can immagine that given this situation my historical database must provide me any kind of bars for the geometrical dataseries and at worst 5 second bars for the "clock" dataseries.

Word of advice?

Started this thread Reply With Quote
  #7 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


nicanorbabula View Post
I am building a new platform and I need at this point to build a historical data too, otherwise it would be very counter-producting to write for MC or NT and backtest there and *then* migrate code to my platform. The backtester (trades engine) is already written, auto-trading part too. All I need is historical data.

My idea is to put all the ticks (also the best ones ) in Google BigQuery or the Google Datastore and then requesting them when backtesting. Everything would run from Amazon instances so internet speed would never be an issue.

My strategies trade futures intraday and work with 2 timeseries of the same future working all like this:
Let's imagine it goes long on green inside-bars and short on red inside-bars. It would wait for a 15 mins inside bar to close then send stop-limit order with the next tick (or the close of the first 1 sec bar after the close of the 15 min inside bar).
So:
Every strategy needs a big timeframe (like 15m, 5m, 60m for geometrical recognition purposes) and a "clock" one (tick, 1 second or at worst 5 seconds). I also trade up to 6 different symbols.

You can immagine that given this situation my historical database must provide me any kind of bars for the geometrical dataseries and at worst 5 second bars for the "clock" dataseries.

Word of advice?

if the auto-trader is written, use the same data format
what does it use ? how did you test it ?

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 nicanorbabula 
Torino Italy
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Broker: AMP/CQG + OEC/OEC
Trading: CL
Posts: 14 since Oct 2014
Thanks Given: 5
Thanks Received: 4


rleplae View Post
if the auto-trader is written, use the same data format
what does it use ? how did you test it ?

Actually, not the data format is the problem, but whether storing all timeframes possible or only tick data.

Started this thread Reply With Quote
  #9 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


nicanorbabula View Post
Actually, not the data format is the problem, but whether storing all timeframes possible or only tick data.

Storing all possible timeframes does absolutely not make any sense.

If you store minute bars, you can convert that in 2, 3, 5, 10, 15, 30 60 or any time frame bars
So storing multiple timeframe time based bars is overlap

If you store tick based information, you have maximum flexibility and every possible time
frame can be derived from the proper tick based information.

Additional information can be bid and ask and the volume at bid and ask.
Additional information can be Level2 (very voluminous)

If you only use time based bars, then storing the lowest level (provided the others are a
multiple off) is sufficient

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 nicanorbabula 
Torino Italy
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Broker: AMP/CQG + OEC/OEC
Trading: CL
Posts: 14 since Oct 2014
Thanks Given: 5
Thanks Received: 4



rleplae View Post
Storing all possible timeframes does absolutely not make any sense.

If you store minute bars, you can convert that in 2, 3, 5, 10, 15, 30 60 or any time frame bars
So storing multiple timeframe time based bars is overlap

If you store tick based information, you have maximum flexibility and every possible time
frame can be derived from the proper tick based information.

Additional information can be bid and ask and the volume at bid and ask.
Additional information can be Level2 (very voluminous)

If you only use time based bars, then storing the lowest level (provided the others are a
multiple off) is sufficient

This actually makes my day! So simple and I didn't think of it

I'll store Ticks and 1 Second bars and maybe, just maybe 1 min bars and daily bars as provided by the source, so that I will be able to build any type of timeframe without having to actually request an infinite amount of data (it would be a sin to load ticks in order to build 1 year worth of daily bars...)

I will use the ticks to build all kind of bars, but time-based ones.
... the 1 Second bars to build up to 1 minute
... the 1 minute bars to build bars up to 23 hours
... the daily ones up to 1 year (will have only 2 years though haha)


Lastly, anybody knows anything about the quality of historical data provided by AMP with Multicharts Special Edition through CQG? How would you measure it programmatically?

Is IQFeed better (saw it mentioned around here a lot)?

Thanks a lot!

Started this thread Reply With Quote




Last Updated on January 18, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts