• Home
  • The MeDCaVE - Research
  • Teaching
    • Teaching
    • BMED444
    • BMED-310-Bisignals&Systems
    • BMED-110-IntrotoProgramming
    • BIOENG-2385 Spring 2015
    • BIOENG-1330-2330
    • BIA Fall 2014
    • Engineering Pittsburgh's High School Curriculum
    • Communicative English
    • Prospective Student?
    • Passing Thoughts
  • Students
    • Students-NoLinks
    • Graduated Degree Students
  • Press
    • Community outreach
    • The MeDCaVE / QuantMD Press
    • FF2Israel2014
    • CIRC Review May 2014
  • Personal
    • The Menon Blog
    • Fiverr.com Gigs
    • Need a 2nd Opinion..?
  • Contact me!
    • Contact me!
    • Jobs
Prahlad G Menon, Ph.D Associate Professor -The MeDCaVE Lab

On Predictability and IntraDay Trading: The Value of a Candlestick

2/8/2016

16 Comments

 
PictureFigure 1. Intraday forecastability analysis.
Typically algorithmic traders attempt to leverage historical stock prices, price movements and functions of price or volume of trades, including Twitter or Stocktwits based sentiment to predict the direction of future stock prices. Such models are often supplemented by a money management strategy which is implemented in the form of a trade execution engine that uses the historical success of predictions made by a trained model or identified pattern to determine the amount of capital to invest (i.e. in the long or short direction) on future predictions. However, all inputs to an algorithmic trading model - machine learning based or simple pattern recognition - are not made equal.  In this blog post, I example the forecast-ability of intraday and end-of-day candlesticks by examining open, high, low, close and volume data, independently as well as in combination.

The approach for this analysis was inspired by Goerg 2012 [1] which presents an adaptation of principal component analysis i.e. a novel dimension reduction technique for temporally dependent signals, utilizing a new forecastability measure, Omega. Omega is an uncertainty metric defined based on the Shannon entropy [2] of the Fourier transform of the autocovariance function of a given univariate time series (i.e. open, high, low, close or volume, in this study). In this manner, Omega therefore forms a quantitative means to separate a multivariate time series into a forecastable (Omega >> 0) and an orthogonal white noise space (i.e. Omega ~ 0).  My analysis of SPY (S&P500 ETF) are presented below.

A look into 5, 10 and 60 minute intraday candlesticks of SPY between 1 Jan 2016 and 5 Feb 2016 led to a rather surprising revelation that intraday "volumes" are a better predictor of its future value than any of the other tested univariate time series' viz. open, high, low and close series'. Surprisingly, close prices - the often recommended gold-standard price that is supposedly least affected by end-effects, instabilities and such was found to be the "least" predictable series!

PictureFigure 2. EOD candlestick forecastability.
Au contraire, and slightly disappointingly so, volume wasn't as forecastable and index using end-of-day (EOD) candlestick data (see Figure 2), while the relative ly poor predictability of close and adjusted-close prices didn't cease to disappoint!

As expected, confidence in the reported forecastability, as evidenced by the p-value for the reported series-specific Omega, reduced as the lag for time series forecasting incremented further and further into the future (owing to perhaps a lesser amount of data being available at 10x5 minute intervals than 1x5 minute intervals, for instance). That said, all reported Omega data in Figure 1 (i.e. 5, 10 and 60 minute intraday candlestick analysis) and Figure 2 (EOD candlestick analysis) were statistically significant. 

Some lessons learned here, perhaps: a) Never underestimate the value of intraday candlesticks; and b) If you're an algorithmic traders attempting to leverage historical stock prices alone to predict prices, think again! Intraday volumes may serve your algorithm some pleasant surprises and improved predictive performance.  

Also of interest might be that an analysis of FCX (Freeport McRoran) and WTI (i.e. a Crude Oil metric - W&T Offshore Inc.) revealed similar results except that WTI adjusted-close prices were classified (based on the Omega / entropy analysis) as "white noise"!  


In principle, it is possible to leverage univariate Omega values as a maximizable objective function to design an optimal function of a time series (or a linear combination of time series') which are more forecastable than any independent univariate time series. Although this so-called optimal time series is likely to be highly stock and tick-interval / candlestick frequency specific, a truly forecastable truth is out there for every ticker! 

Oh, and in case you were wondering what the "blue dotted / dashed lines" were on the plots in Figures 1 and 2 - they represent the heightened level of predictability (i.e. Omega) of a multi-variate index determined as a linear combination of open, high, low, close and volume and open, high, low and close, respectively. In my experiments, so far, a 60% to 70% improvement in predictibility is possible to achieve using a combination of the univariate variable which constitute a standard candlestick time-series dataset.


References:
[1] Goerg GM. Forecastable Component Analysis (ForeCA). arXiv preprint arXiv:1205.4591. 2012 May 21.
[2] 
Shannon, C. E. (1948). A Mathematical Theory of Communication. Bell System Technical Journal 27, 379–23, 623–656.

16 Comments

Chess - getting back into it (Part I) : The Ruy Lopez Opening

10/4/2014

70 Comments

 
This blog entry is the result of playing chess against the computer on three long bus rides from the Faculty apartments in Shunde (China) to the location of the SYSU-CMU Joint Institute of Engineering (JIE) in Guangzhou (China).  The hour long, bumpy bus rides were mind-numbingly boring with often very little breathing space, but they did offer me the opportunity to explore a game (viz. Chess) which I had long since forgotten about... 

Start:  Shunde City, China

Destination: Sun Yat-sen University (SYSU) East Campus

I never thought I'd miss driving a car so much - can't wait to get back home to Pittsburgh after this this semester of teaching at China !
Anyway... Back to Chess!  The following are three interesting game-plays generated while playing against the computer (playing on the Chess.com iPhone app), each using similar opening strategies.  The central theme behind the opening strategies employed in the following three games is 'The Ruy Lopez opening' for 'white'.  This opening was invented sometime in the 1400's and has been proven to carry a small advantage to 'white'. This opening also allows for an early ability to 'castle' and build an attack.  
In games 1 and 3 below, I experiment with the Ruy Lopez opening as 'white' (each resulting in wins for 'white'), whereas in Game 2 I attempt the same opening and force a draw except this time playing as 'black'. In conclusion, it surely does seem like the Ruy Lopez opening is a promising one and can potentially provide either side (viz. 'white' or 'black') a marginal advantage; although, if you do end up playing against someone whom chooses this opening strategy it may certainly be possible to gain back the competitive edge with some tact!

Game 1 -            White (PGM) beats Black (Computer)

Game 2 -         Black (PGM) draws with White (Computer)

Game 3 -            White (PGM) beats Black (Computer)

References:
1) www.Chess.com 
2) http://www.chess.com/blog/monsterking/top-10-most-powerful-openings


Acknowledgements:
Special thanks to my wife, Jessika, for patiently reading the PGN Chess Codes to me which were essential to preparing this blog article. I also thank her and am grateful for her support in enduring this not-so-fun stint in China.
70 Comments

Glimpse of the Holocaust and a World between Wars...

6/1/2014

23 Comments

 
Picture
Today I visited the Holocaust Museum, Yad Vashem, in Jerusalem, Israel. It was truly a frightening experience although the museum itself was a spectacular display of the carnage carried out by the Germans during Word War II (WWII). Revealing the truth about atrocities of WWII by sharing with us her grim experiences was Martha Weiss, holocaust death camp survivor, whom we were fortunate enough to meet as she reminisced the agony of what is meant to be a Holocaust Survivor...   Martha was identified as being a Jew by a traitor in Holland where she had been safe for some years under the protection of a guardian and sent off with her elder sister to the Auschwitz Concentration Camp at age 8. Her parents had sent her to Holland, away her home in the Czechoslovakia, in order for her to remain in hiding under a false 'Aryan' identity and therefore avoid being snagged by anti-Semitic (and as it turns out, highly 'sadistic') German captors - the Nazi SS Officers - carrying out the bidding of Adolf Hitler whom we all know for his falsely justified virulent hatred of the Jews. As per some historians (and evidence in the museum) this false 'justification' for hating the Jews seems to have originated from Darwin’s original ‘survival of the fittest’ theory which was contorted into an incorrect understanding by Hitler’s administration - whom incidentally regarded themselves as 'intellectuals' - that developed and implemented policies designed to protect the ‘superior race’ (i.e. themselves, or as they termed themselves, 'Aryans') and simultaneously preventing the ‘inferior races’ (psychopathically inferred by Hitler and company as being those of Jewish faith) from mixing with those adjudged superior, in order to avoid 'contamination' of the latter’s gene pool [1]. What was originally planned as a mass exodus of those of Jewish faith from Germany, except for 'Essential Jews' whom were given a badge and made to work to support the genocide of their brethren, turn culminated in the ‘final solution’ for the extermination of approximately six million Jews when neighboring countries (as well as ones not so near by) to Germany refused to become 'involved'.  In addition to the Jews, four million other people who belonged to what the German intelligentsia judged as ‘inferior races’ were also made to suffer, starve and then be murdered in cold blood. 

The brutal details of Martha's experiences are beyond the scope of this blog entry but several questions came to mind as I listened to her recounting the pathological and highly psychotic doings of the Nazi's in the pretext of 'Darwinism', and while I mental pieced together evidence presented along the museum's walls.  Is being an anti-Semite a 'feature' encoded in the so called 'Aryan' DNA..?  Is that why Hitler won his election to power with a landslide of 40% support from the German people..?  Is this the reason the SS Officers in the concentration camps had the same virulent fervor as their monstrous and conceited leader - based on a vague theory of 'Darwinism'..?  Is the anti-Semite pathology still latent in our DNA and is this why the world is still at war with the very victims of the holocaust ..?  As I understand from recent visitors to Poland including the holocaust survivors, this virulent hatred for Jews is still rampant in the local population as is evidenced by conniving jives that roll off the tongues of ordinary people such as the conductors of trains as they pass by locations where concentration camps once murdered millions ( ... details available upon request).  Could there be cure for this pathology in the interest of the human civilization being at peace with itself ..?

The Yad Vashem museum provides us a glimpse of the what Jewish life had been before the War and unveils a brave image of the miserable life of slaves which the 'entire world' willed upon the Jews between the world wars and of-course the holocaust.  Over 6 million were murdered but the museum has the goal of attributing a 'name' to every single victim of the holocaust whom were never given a righteous burial. Today they are at 4.2 million named victims and counting as historians continue to rummage through the remnants of the memoirs left behind by holocaust victims and their kin through whom they are survived today...

References:
[1] Darwinism and the Nazi Race Holocaust by Dr. Jerry Bergman on November 1, 1999.  


P.S - The following may be of interest:  http://www.yadvashem.org/yv/en/newsletters/pdf/giving_030-032.pdf



23 Comments

Traveling through Israel

5/29/2014

48 Comments

 
Picture
A mere mile or so from the Gaza Strip, today I made an inspiring visit to a school with bomb-sheltered classrooms dedicated to education in social work (policy and law mostly). Their goal is improving the quality of life of the people in the community by 'listening' to them and helping them "access their rights". — at Sapir Academic College.  This form of education is quite far removed from science and engineering but as far-reaching and impactful in my opinion as a life-saving surgical assist device or biomedical imaging technology.  Such social work is what truly affects the changes for the good around us and it was a deeply touching experience to learn from the experiences of the numerous motivated social workers in Israel.

Follow me on this story as well as the rest of my amazing journey through Israel, with the 2014 Faculty Fellows to Israel program (FF2Israel.org) on my FF2Israel webpage and of-course, on Facebook!




48 Comments

    Personal thoughts on Imaging, IoT, Megatrends, Technology & Travel - 
    The "New" Menon Blog

    Picture

    Prof. Prahlad G Menon, PhD

    Dr. Menon is an Associate Professor of Mathematics with appointments in Bioengineering at University of Pittsburgh and Biomedical Engineering at University of Texas at San Antonio.  He was previously a tenure-track, early-career assistant professor with the department of biomedical engineering at Duquesne University (Pittsburgh, PA) and until May 2015 on the faculty of the electrical and computer engineering (ECE) department in Carnegie Mellon University joint institute of engineering with Sun Yat-sen University (Pittsburgh, PA, USA and Guangzhou, China), where he currently maintains an adjunct professor appointment. He has served as adjunct faculty with the Dept of Biomedical Engineering at Carnegie Mellon University as well as the Heinz College of Information Science at Carnegie Mellon University. Dr. Menon's research group, The MeDCaVE, has its interests in the broad area of AI / data science applied to medical imaging analysis for biomarker discovery and more specifically in computational simulation of vascular flows and cardiovascular biomechanics, with application to diagnostics, surgical planning and interventional guidance.

    Also see the Prospective Student blog if you are a prospective student wishing to become affiliated with The MeDCaVE research group.


    Archives

    March 2023
    November 2020
    September 2017
    August 2017
    May 2016
    February 2016
    December 2015
    November 2015
    February 2015
    October 2014
    August 2014
    July 2014
    June 2014
    May 2014

    Categories

    All
    Chess
    Cloud Computing
    Condition Based Monitoring
    Daily Price Predictions
    Daily Price Predictions
    Data Science
    Education
    Healthcare
    IBM Bluemix
    IoT
    Market Sentiment Analysis
    Market Sentiment Analysis
    Medical Imaging
    Megatrends
    Nature
    Outreach
    Pacs
    Poetry
    Predictive Maintenance
    Radiology
    Real Estate
    Social Work
    Stock Market
    Stock Market
    Supercomputing
    Travel

    RSS Feed

Copyright 2012-14, Prahlad G. Menon
Free Domains