Help visualizing a measure of volatility on a time series? Direct Statistics. - Matlab, R project and Python | futures io social day trading
futures io futures trading


Help visualizing a measure of volatility on a time series? Direct Statistics.
Updated: Views / Replies:3,089 / 9
Created: by forrestang Attachments:5

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Help visualizing a measure of volatility on a time series? Direct Statistics.

  #1 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received

Help visualizing a measure of volatility on a time series? Direct Statistics.

I would like to run some analysis/statistics data on a time series consisting of a column of dates and times, and several columns of price data for OHLC values. I'm looking for some conceptual ideas about how to program this to collect this data on various text files I point it to.

So some background on what I have so far.

I am exporting a text file consisting of the price information in the form of a file that looks like this originally:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Then I've been taking that and creating a fints object which contains all of these times with dates. Here you can see in my workspace the name of the object, "EU1Range." Created using the FTStool. Or equivalant command would be "EU1Range=ascii2fts('EU1Range.txt','t',[],1,1);" Also in this picture you can see this series created in the FTStool, along with a corresponding plot of what the graph looks like. Again this is using a 1tic range bar chart. Here is the picture of that:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Ok.... so with that out the way. The first set of statistics I want to measure is to pick a point, and measure the max distance price moves from that fixed point before returning to it.

Initially, I want to do this with say the price at the beginning of each hour. So as price turns to say 1:00am, I would like to take that price, and measure all the distances in that hour. Then take all these lengths, store them and plot distributions for them. I would like to keep stats for EITHER the ENTIRE data set, or being able to set a look-back period of a given number of hours to plot these distributions.

Here is a picture to help visualize this that I drew:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Here is what that would look like on the actual price chart itself:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Then finally I would like to display these excursions over some look-back period in a distribution.

Any ideas on how I could conceptually accomplish what i want?

Reply With Quote
The following 2 users say Thank You to forrestang for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
arizona
 
Futures Experience: Intermediate
Platform: rolling my own
Favorite Futures: ES,CL,GC,6E
 
GoldStandard's Avatar
 
Posts: 211 since Oct 2009
Thanks: 326 given, 188 received


Sounds a bit like ATR but instead of just showing the maximum, you would plot the distributions of various excursions?

The hard part seems how to plot this since you're adding a new dimension of information. For every point on an ATR, you would have multiple distributions to plot.

Am I understandingn what you are after correctly?


forrestang View Post
I would like to run some analysis/statistics data on a time series consisting of a column of dates and times, and several columns of price data for OHLC values. I'm looking for some conceptual ideas about how to program this to collect this data on various text files I point it to.

So some background on what I have so far.

I am exporting a text file consisting of the price information in the form of a file that looks like this originally:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Then I've been taking that and creating a fints object which contains all of these times with dates. Here you can see in my workspace the name of the object, "EU1Range." Created using the FTStool. Or equivalant command would be "EU1Range=ascii2fts('EU1Range.txt','t',[],1,1);" Also in this picture you can see this series created in the FTStool, along with a corresponding plot of what the graph looks like. Again this is using a 1tic range bar chart. Here is the picture of that:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Ok.... so with that out the way. The first set of statistics I want to measure is to pick a point, and measure the max distance price moves from that fixed point before returning to it.

Initially, I want to do this with say the price at the beginning of each hour. So as price turns to say 1:00am, I would like to take that price, and measure all the distances in that hour. Then take all these lengths, store them and plot distributions for them. I would like to keep stats for EITHER the ENTIRE data set, or being able to set a look-back period of a given number of hours to plot these distributions.

Here is a picture to help visualize this that I drew:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Here is what that would look like on the actual price chart itself:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Then finally I would like to display these excursions over some look-back period in a distribution.

Any ideas on how I could conceptually accomplish what i want?


Reply With Quote
The following user says Thank You to GoldStandard for this post:
 
  #4 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


GoldStandard View Post
Sounds a bit like ATR............

Am I understandingn what you are after correctly?

Hmmmm.

Similar perhaps? I think the main difference is that using the ATR would be like measure the max excursion and nothing else. By that I mean, using say an hourly ATR would report back a SUMMARIZED version of what price did on that hour.

What I am wanting to do is measure each fluctuation about a specific point. So for each hour, there could be say 4 moves back and fourth across the hourly opening..... but an ATR for that hour would just measure the entire range traveled for that hour and summarize it. Does that make sense?

I did a similiar experiment as you describe using 4 hour bars. BTW, this was an idea I found on ET. Where I would find the distances traveled over say the last 21 Four hour bars, and find the distribution of small distances, and the distribution of large distances. Once I had this info, I would then take an entry once price moved beyond that small distance, and exit just short of that large distribution distance.

The idea was that if price moves greater than the SHORT historical distance, it is likely that it will move to the longest distance. There where some subtleties in coming up with this info. Let me know and I can draw a picture or explain more in depth.

So now, the idea is to start with this idea still, but find out exactly HOW the price has moved. Now the hourly starting point is abribtrary for the most part, so it's just the starting point in conceptualizing what I am trying to accomplish.

I rambled quite a bit there. Let me know if this doesn't make sense.

Reply With Quote
 
  #5 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received

Now that you mention it, I think you were saying what I was saying.

So yes, it would be like taking the ATR of price excursion everytime price returns to a start point (in this case the hourly open), and then resetting that ATR. So to think in terms of ATR, yes the ATR would dynamically have to be reset each time price returns back to the starting point, instead of a ATR SUMMARY of every hourly bar.

The idea I think is that this start point could be anything. A new High or Low, it could even be a moving average or a standard deviation of some sort that is based on a moving average. This is just the starting point I would think.

Reply With Quote
 
  #6 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received

Just another CONCEPTUAL idea. The statistics could be kept on just about anything beyond an arbitrary opening.

For example, using the hourly open, and then applying a linear regression based on a moving average. So here the deviation starts at every hour. And one could measure the distance that price moves about the Least Square average (the thick blue one in the center), before the average catches back up.

I've attached a picture explaining this. In the picture you can see the red lines representing just some of the distances that price moves before coming back to the center line.

Attached Thumbnails
Help visualizing a measure of volatility on a time series? Direct Statistics.-prime2011-03-18_153254.jpg  
Reply With Quote
 
  #7 (permalink)
Membership Temporarily Revoked
NYC
 
Futures Experience: None
Platform: graph paper and pencil
Favorite Futures: harp
 
dutchbookmaker's Avatar
 
Posts: 187 since Dec 2010
Thanks: 9 given, 107 received

I've thought about this before also and I think it is just a misunderstanding of volatility. If you picture the time series as more random, volatility is the excitation amount going into the system. Measuring the "jiggle" of price is going to always be dependent on an arbitrary time frame. It really has nothing to do with volatility but the amount of trend vs range bound action on the time frame you are looking at.
For the index I think you will have a hard time beating the VIX as a volatility measure unless you dig deeper into SPX options implied volatility.
This guy has some historic volatility calcs in matlab
http://tradingwithmatlab.blogspot.com/search/label/Historical%20Volatility
Sinclair's Volatility Trading has a nice chapter on them.

Reply With Quote
The following user says Thank You to dutchbookmaker for this post:
 
  #8 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


dutchbookmaker View Post
I've thought about this before also and I think it is just a misunderstanding of volatility. If you picture the time series as more random, volatility is the excitation amount going into the system. Measuring the "jiggle" of price is going to always be dependent on an arbitrary time frame. It really has nothing to do with volatility but the amount of trend vs range bound action on the time frame you are looking at.
For the index I think you will have a hard time beating the VIX as a volatility measure unless you dig deeper into SPX options implied volatility.
This guy has some historic volatility calcs in matlab
I AM OPEN TO FREELANCING. Please contact me if you have any work at home based MATLAB projects: Historical Volatility
Sinclair's Volatility Trading has a nice chapter on them.

Thanks, I have seen that site before.

I think this is telling me that I picked a bad title for this post. As I'm not just interested in knowing "IF" a stock is historically more volatile now than it was prior. Like, looking at VIX, it just tells you if something is volatile, particularly if it is more/less volatile than X number of bars ago. But that alone doesn't tell you 'HOW' you could place a trade.

What I am trying to do is collect DIRECT statistics on price movement, and then apply those stats to find a good place to trade.... if that makes any sense?

Reply With Quote
 
  #9 (permalink)
Membership Temporarily Revoked
NYC
 
Futures Experience: None
Platform: graph paper and pencil
Favorite Futures: harp
 
dutchbookmaker's Avatar
 
Posts: 187 since Dec 2010
Thanks: 9 given, 107 received


forrestang View Post
What I am trying to do is collect DIRECT statistics on price movement, and then apply those stats to find a good place to trade.... if that makes any sense?

It makes total sense...that is to ignore though the stochastic nature of volatility itself....
You can collect the avg length of a 5 min bar? I've done that myself, there is nothing stopping you,....
It was interesting to see the avg 5 min bar length EXPLODE during the crisis....
Normalize your data here...for trend and vol...
I do think of stock pickers pre/post crisis...

Where are the "myspace stocktalk" guys...
I'm right here.......

Reply With Quote
 
  #10 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


What do you want to use volatility for?

I regularly look at the ADR (average daily range), the ATR (average true range) and implied volatility. Usually historical volatility works well as a reference, but there are some periods (such as holidays or end of year), where you cannot use historical volatility.

This is what I use the average true range / average daily range for:

-> calculating money management stop loss
-> displaying seasonal volatility intraday
-> defining trailing stops or MAE (see SuperTrend indicator)
-> establish volatility targets for the day trading session

I do not see any advantage of replacing the average true range with a standard deviation. The standard deviation confuses direction and volatility. Direction is a higher timeframe volatility, so it measures two-dimensional volatility.

If you have a chop market with high volatility going nowhere, the standard deviation can actually be small, although volatility for this time frame is high. The standard deviation does not tell me a lot. This is one reason that I do not use Bollinger Bands, but go for Keltner Channels. Easier to understand what they mean.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > Help visualizing a measure of volatility on a time series? Direct Statistics.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
CTA - Series 3, Series 7, Series 9, Series 10, Series 56 NASD exams certifications Big Mike Traders Hideout 41 January 15th, 2015 10:27 AM
NT7 ES-09-11 ETH time series Angelo1 NinjaTrader 5 July 24th, 2011 10:45 AM
ChaosKit - chaotic time series analysis and prediction LukeGeniol The Elite Circle 9 September 5th, 2010 01:03 PM
Financial Time Series Analysis Method wh The Elite Circle 7 September 5th, 2010 06:59 AM
Multi-time series strategy in NT using different sessions? zwentz NinjaTrader Programming 1 April 2nd, 2010 08:20 AM


All times are GMT -4. The time now is 04:17 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-17 in 0.16 seconds with 20 queries on phoenix via your IP 54.227.51.103