R - one-step-ahead Stochastic Volatility for 5-minute VWAP prices - Matlab, R project and Python | futures io social day trading
futures io futures trading

R - one-step-ahead Stochastic Volatility for 5-minute VWAP prices
Updated: Views / Replies:770 / 2
Created: by Big Mike Attachments:1

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

Thread Tools Search this Thread

R - one-step-ahead Stochastic Volatility for 5-minute VWAP prices

  #1 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 46,335 since Jun 2009
Thanks: 29,444 given, 83,932 received

R - one-step-ahead Stochastic Volatility for 5-minute VWAP prices

I found this interesting so am cross-posting it from Quant Stack Exchange.

Source: r - one-step-ahead Stochastic Volatility for 5-minute VWAP prices - Quantitative Finance Stack Exchange

If anyone can comment on the accuracy of the formula, please do so either here on futures.io (formerly BMT) or on the original question URL.

I'm trying to run an SV model against prices of Euro/USD. For those not familiar with SV, its a volatility model in which each point gets its own volatility parameter ht with 3 main parameters that are derived using a monte carlo simulation (MCMC),

μ = average of the volatility across the entire sample set
ϕ = the weighting that the volatility of the last point has on thenext (predicted) volatility
ht = the most recent - {time interval}'s volatility.
σ = volatility of the volatility
Once we have μ, ϕ, and ht we can predict ht+1, that is, the predicted volatility of the next point, by ht+1∼Normal(μ+ϕ(ht−μ),σ).

I'm wondering if I'm doing the next part correctly:

To put this into practice, we run a MCMC every 5 minutes, gathering those variables and predicting ht+1. This results in a graph like this, for CME futures contract 6EU4 (September euro) with 5-period BBands also displayed. Ignore the shapes that appear on the graph.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

It feels inaccurate, so I'm not sure if I'm doing something wrong. Did I understand the process correctly? phi is around .55 for the first half of the day, then jumps to .95 and stays there, which seems wrong, but I guess it isn't too surprising given the data...

R's package stochvol is taking care of the parameter estimation, so assume that the numbers themselves are accurate.

Should I paste the 5-minute Volume Weighted Average Prices here? its a pretty long data set. I'll edit it to do that if so.


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike 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)
Trading for Fun
Buffalo, NY
Futures Experience: None
Platform: Python, Excel, R, Ninjatrader
Broker/Data: IB quandl
Favorite Futures: Low frequency trading
Posts: 64 since Jul 2014
Thanks: 4 given, 37 received

Looks really interesting.

Here is a test script pieced from the manual. I have no idea about the actual question though.


stockData <- new.env()
startDate = as.Date("2004-01-13")
endDate = as.Date("2014-08-25")
tickers <- c("SPY","QQQ")
getSymbols(tickers, env = stockData, src = "yahoo", from = startDate, to = endDate)

ret <- dailyReturn(stockData$QQQ,type='log')

res <- svsample(ret, priormu = c(-10, 1), priorphi = c(20, 1.1),priorsigma = .1)

volplot(res, forecast = 100)

Attached Thumbnails
R - one-step-ahead Stochastic Volatility for 5-minute VWAP prices-stochvol.jpeg  
Reply With Quote
The following 2 users say Thank You to NoiseTrader716 for this post:


futures io > > > > R - one-step-ahead Stochastic Volatility for 5-minute VWAP prices

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buckle Up: More Volatility Ahead for Stock Market Quick Summary News and Current Events 0 February 26th, 2013 10:50 PM
How to take the VWAP little v off beside matrix prices? r3algood TradeStation 2 July 31st, 2012 01:26 PM
No Shocker, More Volatility Ahead for Stocks Thursday Quick Summary News and Current Events 0 August 11th, 2011 01:00 AM
Week Ahead: Debt Talks, Earnings Will Whip Up Volatility Quick Summary News and Current Events 0 July 17th, 2011 06:10 PM
Week Ahead: Expect Volatility as Fed Yanks Security Blanket Quick Summary News and Current Events 0 June 24th, 2011 11:40 PM

All times are GMT -4. The time now is 01:29 AM.

Copyright © 2018 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 2018-05-21 in 0.08 seconds with 20 queries on phoenix via your IP