Probability Distribution, Statistics - Algorithmic Trading

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • We will discuss how to get trade ideas from a simple probabilikty distribution curve with Apple stock (AAPL) as an example.
    The full trading view pinescript code can be found in the link below:
    www.quantprogr...
    Disclaimer: The contents provided in the channel are purely educational. We do not provide any financial or investment advice. There is a very high degree of risk involved in trading. Past results are not indicative of future returns. quantprogram.com and all individuals affiliated with this site assume no responsibilities for your trading and investment results. The contents, videos, columns, articles and all other features are for educational purposes only and should not be construed as investment advice.

КОМЕНТАРІ • 61

  • @felipemiraflores2984
    @felipemiraflores2984 Рік тому +22

    This video has opened my eyes when it comes to trading with simple and effective strategies based on probability. Amazing video!!!!

  • @honzinuvsvet4102
    @honzinuvsvet4102 2 роки тому +31

    This is exactly why I´m trying to focus on ´´facts´´ about market- volume, vwap, stand. deviation also support resistance. Loving your videos!

  • @joewarren6439
    @joewarren6439 3 роки тому +8

    You are an awesome technician. I love the Stan Weinstein code you provided and have created TOS screens to identify potential trades based on 30 weeks and 50 days both providing many trade possibilities. Thank you.

    • @quantprogram
      @quantprogram  3 роки тому +1

      Thanks so much mate. Happy to help

  • @fatbat4990
    @fatbat4990 27 днів тому +2

    Gotta love the singing crows in the background.

  • @dontbeafool
    @dontbeafool 2 роки тому +9

    good video. you should have a look at meta labling.
    basically, you keep your strategy but you take other metrics like volatility, skewness, autucorrelation,etc. you use them with your backrest results to build a classifier(any ml model) on top of your strategy so that your model can prevent trade execution if it knows with enough certainty it wont be profitable. it eliminates a lot of drawdown

    • @quantprogram
      @quantprogram  2 роки тому +1

      Thanks much for the info mate. Will look into this

    • @dontbeafool
      @dontbeafool 2 роки тому

      @@quantprogram do you have discord? I'd love to chat. I just graduated Msc in finance and I've been diving deep into machine learning. Just starting my algo trading journey byt I'm sure we could benefit mutually from sharing knowledge.

    • @quantprogram
      @quantprogram  2 роки тому +3

      @@dontbeafool Congratulations on your Master in Finance. I have a Masters in Risk Management and Financial Engineering. I learned more outside of my education really. Practical knowledge has its own perks.
      Unfortunately I don't use discord mate. Honestly I just don't have the time to spare. Not to mention the hassle. The youtube thingy itself is just a side passion of mine to teach people the advantages of quantitative based trading. I'll be more than happy to discuss with you via e-mail.

    • @TheMorhaGroup
      @TheMorhaGroup 18 днів тому

      ​@@dontbeafool I would love to have a chat if you are ever free, I have just recently switched to a strictly mathematical based strategy and would love to have input on my equations from someone like yourself

  • @flashrun6093
    @flashrun6093 10 місяців тому +2

    One can store in code, the value for the variable percentage. In Pine Script, just use a switch for any security desired.

  • @stephenmillerPSF
    @stephenmillerPSF 18 днів тому

    Wow why didn't I think of this?! What's the probability dist curve program/ indicator called that you use in trading view?

  • @brandonjohnson8880
    @brandonjohnson8880 Рік тому +1

    The extreme levels also show that the returns are not normal. The distribution is also heavier on the negative side. I believe stock returns are distributed with the Cauchy.
    Try this: calculate the probability under normal assumption that you get a 5% decline. Then compare that with the probability you get from the data. In reality, the data will show a higher probability

    • @quantprogram
      @quantprogram  Рік тому

      HI Brandon, Thanks for the comment and I find it interesting but a few questions regarding the approach.
      1.If i am assuming that i get a 5% decline whats the a data that i feed. is it the same as before or only data with the 5% decline?
      2."Then compare that with the probability you get from the data". Compare to which data?. The results i did with the video?

    • @brandonjohnson8880
      @brandonjohnson8880 Рік тому

      @@quantprogram yeah, so I was thinking this: calculate your mean and standard deviation from the data. Now construct a normal distribution from these, and find the probability that you get a 5% decline or worse (assumption of normality). Now take your data and find the percentage of days that had 5% or worse. Do they line up? My bet is that your data will show it more frequently than the normal distribution model. This would indicate that the normal distribution is not appropriate.

    • @quantprogram
      @quantprogram  Рік тому

      @@brandonjohnson8880 I will give it a go. But my concern is that the amount of days there are when the stock is having 5% or worse is so limited as compared to normal data that its quite unreasonable to use it as a comparative measure. If you understand what i mean. Maybe if i do it for multiple stocks I can get more data

    • @brandonjohnson8880
      @brandonjohnson8880 Рік тому

      @@quantprogram you are right. Maybe with more stocks. Also you could try it on a lower timeframe as an experiment (10 min bars) to get more data as a test. Then use a lower return level than 5%

    • @quantprogram
      @quantprogram  Рік тому

      @@brandonjohnson8880 Thanks mate, Lower timeframe is a great suggestion. Will look into it

  • @iinself66
    @iinself66 5 місяців тому +1

    thanks for the video. can you please explain how is this different from Bollinger bands?

  • @RuDyyx
    @RuDyyx 3 місяці тому +3

    One thing, financial markets don't follow normal distribution.

    • @quantprogram
      @quantprogram  2 місяці тому +4

      You’re 100% correct. In fact, no single distribution is entirely accurate in predicting financial market returns. But we have to start with some assumptions to create a model. This could be a normal distribution ot students t-distribution, lognormal distribution, or a hyperbolic distribution. Once we structure a model we can make it a base for refinement and testing

  • @FastbreaKHere
    @FastbreaKHere Рік тому

    In the past Ive tried to model the stock daily returns with the normal distr. but everytime I had a p_value test with very small values (less than 0.001), whereas I got good results with the student T distribution.

    • @quantprogram
      @quantprogram  Рік тому

      Thats interesting mate. Good work. t distribution are used by quants as well

  • @MrEstebanEscudero
    @MrEstebanEscudero 2 роки тому +3

    Great video. Subscribed

  • @eddiemurphie3429
    @eddiemurphie3429 8 місяців тому

    This is a long shot ask, will u please teach me !

  • @ralphpatterson232
    @ralphpatterson232 8 місяців тому

    Thanks for the video. While I don't mind being on a mailing list if it is informational in nature, but I would appreciate a more direct link to the code you used. The only code available (from the link in the response email) is to the random seed. It would be nice to have the entire Juniper notebook to work with. If I'm missing something please correct me.

    • @quantprogram
      @quantprogram  8 місяців тому

      Hi, Im finding it hard to understand what you're trying to communicate. Firstly the link only gives you the strategy thats discussed in the video, not the jupyter notebook. This was said in the video. I'm not sure if you watched the video thoroughly.
      Secondly, there is no "random seed" in any of the code that we discussed for "probability distribution" video. So i dont know know where you go that info.However random seed function is used for our another video "Jim Simons Simulation Data". I can see from our systems that you have downloaded both. Dont know if you misunderstood which is which.
      The jupyter notebook file for "Probability distribution" wasn't uploaded because all the code for that was discussed line by line in the video, it would probably take you less than 5 minutes for anyone to recreate the code just by watching the code in the video and typing it unlike "simulation data" code.

  • @georgekuh4491
    @georgekuh4491 7 місяців тому

    Can you suggest a book for statistical analysis

  • @BoxerDogs
    @BoxerDogs 4 місяці тому

    At 1:46, what are the values on the Y-axis and what are the units? What is the Y-axis telling you?

    • @sisco7657
      @sisco7657 Місяць тому

      The y-axis is for percentage. As in 0.4=40%

  • @navketan1965
    @navketan1965 10 місяців тому

    Sir, Assuming forex pair prices are random--how often do you think currency reaches past value of daily ADR from opening price(5PM EST) on one given day either up or down--if percentages are low,then trader can make money by just limit orders put in at start of every day(win/lose).Put(for example) buy orders 80%(of ADR) below EOD(end of day)price & stop loss past distance where pair is unlikely to reach most of the times. At the end of day cancel unfilled orders & new orders are entered according to new EOD prices.Vice versa for sell orders.Stop loss reversal order is at where market is unlikely to go most of the times.Seek your wisdom.

    • @quantprogram
      @quantprogram  10 місяців тому

      This does sound like a market maker strategy method but applied just once a day. but it will hard to backtest as we will never know how many of your limit orders will be filled, some might not be filled. Also the amount of trades might be less in less volatile markets. The risk part could be when you have black swan events. But without a through back test we cant go deep in to understanding the mae and mfe

  • @abelpandian1437
    @abelpandian1437 15 днів тому

    Market profile

  • @matejfrnka8194
    @matejfrnka8194 2 роки тому +2

    Hi, what is the app you are using for displaying the stock chart called?

    • @quantprogram
      @quantprogram  2 роки тому +1

      The coding is done both in python and in Tradingview

  • @pragneshmistry6845
    @pragneshmistry6845 Рік тому

    Sir, the data for the period u have downloaded is normally distributed, so this can apply. But for the same stock if we change the period, the said stock data may not normally distributed, where we may not apply this… please help me

    • @quantprogram
      @quantprogram  Рік тому +1

      Hi Pragnesh, There is no need to change to shorter time frame, that would be a mistake. The more data we have, the more predictive decision we could make. taking shorter periods data is like saying we are going to predict the weather for the next 10 years with just last weeks data.
      Also no stock will be strictly normally distributed. We are taking an assumption of normally distribution and trying to work a model from there.

    • @pragneshmistry6845
      @pragneshmistry6845 Рік тому

      @@quantprogram Thanks for your reply to my previous comment. I understand that using more data is generally better for making predictive decisions. However, I'm still curious about what we can do if we want to create a strategy for data that is not normally distributed.

    • @quantprogram
      @quantprogram  Рік тому +1

      Like I said in the previous comment. We are taking an assumption of a normal distribution. There will never be a perfect normal distribution. The data of stocks over a long time period can show signs of normal distribution but that doesn’t mean it’s strict normal distribution. Many financial models are based on this assumption including black scholes option pricing model.
      I am finding a hard time to understand your situation. If you don’t have data that has traits for normal distribution data then most likely you have limited data. Why would you want to create strategy for limited data?
      Now let’s say you have lots of data for a specific stock and it’s still not having traits of normal distribution. Why would you want to trade that stock?. You see the dilemma. Part of investing and trading process is to say no to some situations or investments. If there is no evidence why bother trade it. Trade something where you can find evidences

  • @abcnikhiltripathi
    @abcnikhiltripathi 5 місяців тому

    It looks like your backtest result (1182%) gain doesn't beat the "buy and hold" returns (1700%) between Dec 2009 to Dec 2020.

    • @quantprogram
      @quantprogram  5 місяців тому

      Yes.. I dont understand the context of your message here. No strategy will beat buy and hold of all stocks as practicality most of them where penny stock once. So using buy and hold for x amount of years as comparison measure is useless. The comparison should be done with buy and hold on SPX an index ETF as that is the standard comparative measure. and even for that we should take cagr to dd ratio. The cagr for SPX being 10% AND DD 55% during GFC. This performace is what all investors are trying to beat including buffet or lynch...or any hedge fund performance.

  • @Conork737
    @Conork737 2 роки тому +1

    Do you know if there's an easy way to make the Normal Distribution for stocks via a website or app?

    • @quantprogram
      @quantprogram  2 роки тому +1

      Not that i'm aware of mate. But its quite easy in python

    • @Conork737
      @Conork737 2 роки тому

      @@quantprogram thanks for the reply, it's actually for an assignment. I found a way via Excel. Thank you for the video though, was very helpful

    • @sharmaasutosh
      @sharmaasutosh 2 роки тому

      @@Conork737 please can you tell how we do this through excel

    • @Conork737
      @Conork737 2 роки тому +1

      @@sharmaasutosh there's plenty of UA-cam videos showing how to if you give it a search. If you can't find one I'll try link one that I used

    • @dontbeafool
      @dontbeafool 2 роки тому +1

      use python and you can fit the true distribution with simple packages like fitter.

  • @talentinvein7213
    @talentinvein7213 5 місяців тому

    this look like 80-20 principle. here 68

  • @stevenaohio
    @stevenaohio Рік тому

    I only see 8 lines of code in the link provided in email. Can you provide more detailed or logic of your pine script for code?

    • @quantprogram
      @quantprogram  Рік тому

      Hi mate, There are only 8 lines of code for that strategy coded in pinescript. The logic behind the strategy is explained in this video from 04:14.
      If you are looking to understand pinescript coding language thoroughly, please go through are Tradingview Pinescript full tutorial version 5 found on our channel.

  • @KazukiSymmons
    @KazukiSymmons 6 місяців тому

    I put in my email but cant get reply

    • @andreasjmb
      @andreasjmb 3 місяці тому

      same here... did you eventually get the reply?

  • @JohnEnergy2012
    @JohnEnergy2012 Рік тому