NexusFi: Find Your Edge


Home Menu

 





Learning statistical analysis: Step by Step


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one jackbravo with 11 posts (4 thanks)
    2. looks_two wldman with 5 posts (5 thanks)
    3. looks_3 iantg with 4 posts (7 thanks)
    4. looks_4 Ozquant with 3 posts (4 thanks)
      Best Posters
    1. looks_one SMCJB with 2 thanks per post
    2. looks_two iantg with 1.8 thanks per post
    3. looks_3 wldman with 1 thanks per post
    4. looks_4 jackbravo with 0.4 thanks per post
    1. trending_up 8,553 views
    2. thumb_up 29 thanks given
    3. group 13 followers
    1. forum 29 posts
    2. attach_file 9 attachments




 
Search this Thread

Learning statistical analysis: Step by Step

  #21 (permalink)
 iantg 
charlotte nc
 
Experience: Advanced
Platform: My Own System
Broker: Optimus
Trading: Emini (ES, YM, NQ, ect.)
Posts: 408 since Jan 2015
Thanks Given: 90
Thanks Received: 1,147

jackbravo,

I would definitely say you are onto it! Knowing all of this and seeing all of the forces against you in the market are key.

Separating the various aspects of the house edge out like this really helped me be able to know what obstacles I needed to address. Some of these are easier to work around than others obviously.

I will throw out one helpful peace of advise that really made a huge difference for me in cracking this.
When looking at price (1 tick up, 1 tick down, etc.). It is very important to delineate the difference between flipping which side is currently getting served (The Bid Volumes or the Ask Volumes) this creates a tick up or a tick down and as the market is serving both sides I consider this to be largely arbitrary price movement that really doesn't matter. But when there is a level change in the books. I.E The entire Bid / Ask level moves up or down by one tick because a level cleared, this is a key event and very different than the former ticking between the two volumes.

Now keep in mind that you can pick your entry at a point in time so specific that you could enter when the last price = bid price, or the last price = ask price, you can find tune your entry to filter out the previous mentioned noise that I consider arbitrary. There are a number of ways of characterizing the play here, but I could write a whole book on the research I have done in cracking the ways levels are cleared and how volumes, and price and sequencing work. I would almost call this nano-structure because it is a field of study even more granular that most micro-structure studying.

But this field of research is where you can start to take back all of the house edge....

Happy Trading!

Ian




jackbravo View Post
Hey Ian - thanks for your time in discussing this!

I wanted to see if I can calculate the probabilities based on the following assumptions:
1. Uptick and downtick are independent of each other
2. Market order entry: have to pay spread (-1tick)
3. Target does not require pass-through (which can occur if you're early enough): do not have to pay spread
4. Stoploss does not require pass-through (market order)



What I came up with is there is a 4:1 odds against you of making your target. There's a pretty steep house edge, even not taking commissions into account.

@Ozquant Thanks for your advice and links! I'm going those links to my exploration.
@wldman I'd love to start a discussion about what you came up with (as much as you want to share), and more importantly, how exactly you came up with it. How did you calculate the statistics, etc. That'd be a great example for me to learn from.


Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
ZombieSqueeze
Platforms and Indicators
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Are there any eval firms that allow you to sink to your …
Traders Hideout
Exit Strategy
NinjaTrader
 
  #22 (permalink)
 
jackbravo's Avatar
 jackbravo 
SF, CA/USA
 
Experience: Beginner
Platform: SC
Broker: Stage 5
Trading: NQ...uh..ES actually
Posts: 1,337 since Jun 2014
Thanks Given: 4,362
Thanks Received: 2,400

@wldman Thanks for sharing the excel sheet, Dan! I am looking forward to the explanations. So far, I can see HL, Range, Median, Open, and a 10-day average range.

"It does not matter how slowly you go, as long as you do not stop." Confucius
Started this thread Reply With Quote
  #23 (permalink)
 
jackbravo's Avatar
 jackbravo 
SF, CA/USA
 
Experience: Beginner
Platform: SC
Broker: Stage 5
Trading: NQ...uh..ES actually
Posts: 1,337 since Jun 2014
Thanks Given: 4,362
Thanks Received: 2,400


Alright, I've created my first backtest study in excel using daily RTH data on the NQ.

1. Study performed on RTH hours of the NQ. Data is from from Sierrachart, starting in 2012, with volume-based rollover
2. Looked for a Tuesday gap from Monday or Friday (if it was a 3-day weekend). Gap is defined as Tuesday low greater than Monday or Friday close.
3. If there was a tuesday RTH gap, buy Wednesday RTH open and exit Friday RTH close
4. Two control tests were performed. A daily RTH buy @open and sell @close, and a 3-Day buy@open and sell@ close (to simulate buying Wed open, and selling Fri close)

For the calculations, I used LOG[current price/previous price]. The reason I used this calculation is because I read in the Adam Grimes' book that log of returns simulates compounding returns. Additionally, log returns can be manipulated by simple math, and directly compared.

Here are the results:
Control study daily total returns: 18.76% from November 28, 2012 to present; 726 positive days, 5 neutral days, 583 negative days
Control study 3Day total returns: 99.69% from November 28, 2012 to present; 786 positive trades, 4 breakeven trades, 524 losing trades
GAP test returns: 0.04% from November 28, 2012 to present; 32 positive trades, 0 breakeven trades, 28 losing trades

It appears that buying after a Tuesday RTH gap and exiting Friday RTH close does not have a clear edge.
It appears that buying and holding for all 3 day groups does have an edge (not sure how you would do this in real-life other than having 3 separate accounts)
Attached spreadsheet.

Any feedback on calculations, further statistics to generate, or anything else, would be appreciated.

"It does not matter how slowly you go, as long as you do not stop." Confucius
Attached Files
Elite Membership required to download: NQH8-testing.xlsx
Started this thread Reply With Quote
  #24 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,944 since Sep 2015
Thanks Given: 15,447
Thanks Received: 15,291

hi @jackbravo

Sorry I can't help with feedback about the post above - it's a format and reasoning I am not familiar with.

I thought however I would share a link to a post I wrote a while back to exemplify my own take of a statistical edge.

Hope it helps/makes sense.

Reply With Quote
Thanked by:
  #25 (permalink)
 
jackbravo's Avatar
 jackbravo 
SF, CA/USA
 
Experience: Beginner
Platform: SC
Broker: Stage 5
Trading: NQ...uh..ES actually
Posts: 1,337 since Jun 2014
Thanks Given: 4,362
Thanks Received: 2,400


xplorer View Post
hi @jackbravo

Sorry I can't help with feedback about the post above - it's a format and reasoning I am not familiar with.

I thought however I would share a link to a post I wrote a while back to exemplify my own take of a statistical edge.

Hope it helps/makes sense.

Thanks Xplorer!

"It does not matter how slowly you go, as long as you do not stop." Confucius
Started this thread Reply With Quote
  #26 (permalink)
 
Giamsterdam's Avatar
 Giamsterdam 
Amsterdam
 
Experience: Beginner
Platform: Sierra Charts
Broker: AMP
Trading: ES
Posts: 83 since Jan 2018
Thanks Given: 121
Thanks Received: 84

Here is something I'm planning on studying when I'm done learning more about futures and order flow:

I cant post links cause of my limited posts amount but there is a free statistical and probability course on khan academy

Maybe it can help someone.

Giacomo

Reply With Quote
Thanked by:
  #27 (permalink)
 
jackbravo's Avatar
 jackbravo 
SF, CA/USA
 
Experience: Beginner
Platform: SC
Broker: Stage 5
Trading: NQ...uh..ES actually
Posts: 1,337 since Jun 2014
Thanks Given: 4,362
Thanks Received: 2,400


Giamsterdam4x View Post
Here is something I'm planning on studying when I'm done learning more about futures and order flow:

I cant post links cause of my limited posts amount but there is a free statistical and probability course on khan academy

Maybe it can help someone.

Giacomo


Thanks for the heads up. I actually starting going through one of the courses on probability:

https://www.khanacademy.org/math/precalculus/prob-comb

"It does not matter how slowly you go, as long as you do not stop." Confucius
Started this thread Reply With Quote
  #28 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,041 since Dec 2013
Thanks Given: 4,375
Thanks Received: 10,192

@jackbravo good luck in your journey.


jackbravo View Post
Any comments, feedback, help, or guidance is appreciated!

Having a good reliable data source is very very important.


jackbravo View Post
I read Adam Grime's book, "Quantitative Analysis of Market Data: a Primer." It's a very short book, but has a great overview of market math for beginners like me. One concept he talks about is standardizing the price of securities to themselves, in order to really figure out how they moved. There are two similar ways to do that:

1. Percent returns
2. Log returns

This may work for equities, but with futures it only works if your looking at NON-roll adjusted futures. How can that be the case? Well every time a contract expires/rolls to next expiry, the back adjusted prices all alter, and hence the return and log return all alter as well. Also back-adjusted contracts, can and do go negative if you go far enough back in history.

Reply With Quote
Thanked by:
  #29 (permalink)
 
jackbravo's Avatar
 jackbravo 
SF, CA/USA
 
Experience: Beginner
Platform: SC
Broker: Stage 5
Trading: NQ...uh..ES actually
Posts: 1,337 since Jun 2014
Thanks Given: 4,362
Thanks Received: 2,400


SMCJB View Post
@jackbravo good luck in your journey.


Having a good reliable data source is very very important.

This may work for equities, but with futures it only works if your looking at NON-roll adjusted futures. How can that be the case? Well every time a contract expires/rolls to next expiry, the back adjusted prices all alter, and hence the return and log return all alter as well. Also back-adjusted contracts, can and do go negative if you go far enough back in history.

Ah..thanks for those tips. Makes sense.

How does one know if a data source is reliable? I'm using Sierra Chart historical data (which I believe comes from barchart) and Gain top of the book data. Is there a "gold-standard" data set or data feed to compare?

"It does not matter how slowly you go, as long as you do not stop." Confucius
Started this thread Reply With Quote
  #30 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,041 since Dec 2013
Thanks Given: 4,375
Thanks Received: 10,192



jackbravo View Post
Ah..thanks for those tips. Makes sense.

How does one know if a data source is reliable? I'm using Sierra Chart historical data (which I believe comes from barchart) and Gain top of the book data. Is there a "gold-standard" data set or data feed to compare?

I'm not sure there is a gold standard of data but there are many data issues that can catch you unaware. For example
  • Survivor-ship bias
  • Stock Splits
  • Stock Dividends
  • How roll adjusted contracts are calculated. Different systems & vendors do it in different ways. One of the data providers I use actually changed this for one contract at the end of 2016 but never told anybody. I only realized because I couldn't reconcile some roll costs. If your rolling on different days than your data - watch out.
  • using non-linear calculations on roll adjusted data (eg percent, log, ratios etc)
  • Deferred Contracts. I find that when using deferred contracts that many data vendors not only provide different results for the same product but also data that is sometimes plain wrong. In the last month I've discovered that two of the data providers I use currently return the wrong prices when you request deferred Eurodollar contracts. Admittedly Eurodollar has a weird contract structure but bad data is bad data.
Finally I've heard people claim that when testing automated strategies that use different data providers yield different results. If the data was the same that shouldn't be possible.

Reply With Quote
Thanked by:




Last Updated on January 28, 2018


© 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