Jim Simons Trading Secrets 1.1 MARKOV Process

Поделиться
HTML-код
  • Опубликовано: 14 май 2024
  • Jim Simons is considered to be one of the best traders of all time he has even beaten the like of Warren Buffet, Peter Lynch, Steve Cohen and Ray Dalio. Jim's Renaissance Technologies and Medallion Fund are purely quantitative trading funds. The methodology he and his team uses are highly secretive but there are lots of hidden clues and approaches that could be found in the book The Man Who Solved the Market
    In this video we dissect the Markov process approach found in the book in simple terms and how we can use it to find amazing strategies with codes written in Python for research and Tradingview pinescript for application. We do a practical real world example in SPY.
    The codes for both the Python file and Pinescript can be found here:
    www.quantprogram.com/MarkovTr...
    Timecodes
    00:00 - Intro
    01:00 - Book Evidence and Interpretations
    02:36 - Markov Strategy results on Course
    04:37 - What is Markov Process, Examples
    04:28 - Markov Probabilities Examples
    07:15 - Markov Trading Example
    09:10 - Transition Matrix Probabilities
    10:29 - Application Of Markov in Python for SPY
    12:40 - Transition matrix for SPY
    15:20 - Applying single condition on Pinescript
    16:13 - Interpretation of Results and Improvement
    Our Course's
    www.quantprogram.com/store
    Full Beginner Tutorial for Tradingview Pinecript: • Tradingview Pinescript...
    RSI Strategy Backtested Pinescript: • RSI Strategy Backteste...
    Backtesting Pullback Strategy Pinecript: • Pullback Strategy Back...
    Stan Weinstein Strategy Pinecript code: • Stan Weinstein's Tradi...
    Create Stop Loss Take Profit Code: • Create Stop Loss and T...
    Creating Trailing stop Loss in Tradingview Pinescript: • Trailing Stop Loss Cod...
    RSI divergence V4 Pinescript code: • RSI Divergence Pinescr...
    Donchian Breakout Pinescript Code: • Donchian Channel Break...
    Inside day Strategy Pinescript Code: • Backtesting Inside da...
    Bullish Engulfing Strategy Pinescript Code: • BACKTESTING Candlestic...
    www.quantprogram.com/RSI_Dive...
    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.

Комментарии • 196

  • @quantprogram
    @quantprogram  8 месяцев назад +39

    The second part of the video that talks about how Jim Simons generates simulated data can be found on our RUclips channel. If you have no experience in python watch our full "Algorithmic trading in Python Zero to Hero" Video also found on our channel

    • @NishantChoudharyJi
      @NishantChoudharyJi 7 месяцев назад

      I am interested to join your training program.
      Request you to please provide me more details

    • @rozsadnymarek5988
      @rozsadnymarek5988 3 месяца назад

      Your video is useless as all "guru" trading videos. Markov models are *ONLY VALID* when time series exhibit *markov property.*
      FINANCIAL TIME SERIES *DOES NOT EXHIBIT MARKOV PROPERTY !!!* SO STOP SPREADING BULSHITS !!!
      You selected the backtest on specific period to provide a false "evidence".
      That's how it works folks..

  • @eduardomafra4076
    @eduardomafra4076 2 месяца назад +3

    The mind-blowing video opened my mind to the quant model trading in terms of application to the real world. I've read a lot about it but never had this insightful explanation.

    • @quantprogram
      @quantprogram  2 месяца назад

      Thank you so much. Appreciate it

  • @gamuchiraindawana2827
    @gamuchiraindawana2827 9 дней назад +2

    Please keep making more videos about reinforcement learning concepts this is amazing, no on else on youtube is breaking down these concepts as gracefully as you just did, phenomenal stuff man. Thank you

    • @quantprogram
      @quantprogram  8 дней назад +1

      Will do mate . Thanks for watching

  • @VikBrummer
    @VikBrummer Месяц назад

    What a fantastic expansion of the Markov process thank you so much!

  • @chrisarets2231
    @chrisarets2231 Год назад +12

    Interesting approach to looking at trading data!

  • @nollieflip1
    @nollieflip1 8 месяцев назад +31

    High quality content. Love this.

  • @Regular.Biceps
    @Regular.Biceps 3 месяца назад +5

    I know you wanted to keep it simple for the users but you back tested the strategy on the same sample on which you have calculated odds.. in reality, the sample is continuously changing and it might not behave in the same manner in future with same odds
    Greay explanation for Markov odd through... One of the finest segment of this video

    • @quantprogram
      @quantprogram  3 месяца назад +6

      Thanks for watching but your statement is not entirely true. The data for sample for the testing the strategy and the calculation of odds are different. The testing starts from 1993 as compared to odds calculation which was calculated from 2010. So its not in the entirety the same same sample. We have got out of sample data of 17 years. However, it is true the sample size for test and training should be entirely different. My sincere apologies. My explanation could have been better, i forgot to be more specific about the forward test.
      I don't know if you're new to our channel, i talk about splitting training and testing data in most of my videos, it was quite redundant here, the goal of the video was to explain markov process. Will do better next time

  • @Kokoroko9
    @Kokoroko9 6 месяцев назад +6

    Mindblowing content I have so many strats and ideas I have never been able to correctly back test , will look at your other content with huge enthusiasm have a great weekend

    • @a.b.712
      @a.b.712 3 месяца назад +1

      dont use tradingview for your backstests, its not accurate

    • @Kokoroko9
      @Kokoroko9 3 месяца назад

      @@a.b.712 yeah not a lover of TV ,, Sierra is good but I find that a pain to so majority im just on mt4/5 but accuracy is questionable

  • @chandannath8654
    @chandannath8654 7 месяцев назад +4

    never thought that Markov model would be deployed in trading. have read the Hidden Markov chain long ago

  • @majorkuntz
    @majorkuntz Месяц назад +5

    Possibly a coincidence but random forrest also gives a 57% probability on the same ticker.

  • @timothyyee1966
    @timothyyee1966 7 месяцев назад +29

    Good thing I took linear algebra. Markov chains was the one thing I actually learned and enjoyed learning. Thank you for the explanation and coding walk through.

    • @quantprogram
      @quantprogram  7 месяцев назад

      Thanks much mate. Appreciate it

    • @FreerideRabbit
      @FreerideRabbit 6 месяцев назад +7

      markov chains are not taught in linear algebra haha

    • @Eduardo-if3zc
      @Eduardo-if3zc 6 месяцев назад +2

      ​@@FreerideRabbit they are. I'm learning about Markov chains now in linear algebra 2

    • @gamuchiraindawana2827
      @gamuchiraindawana2827 9 дней назад

      @@FreerideRabbit Bro don't think every school is structured the same.

  • @nabilsn411
    @nabilsn411 2 месяца назад +3

    i like to marcov process , he is defining the probability for the price to go same origin , we can apply this for polynomial regression , as the price has good probability to get back to middle line.

  • @RavindraElicherla
    @RavindraElicherla Месяц назад

    Awesome Video. Keep up the great work!!!

  • @zch3n
    @zch3n Месяц назад +13

    The code " data[ (data["state"] == "up") & (data["state"].shift(-1) == "down") ] " will return rows in the pandas DataFrame where the current state is "up" and the next state (shifted by one position) is "down". It should be "up_to_down" instead

  • @Ash__7
    @Ash__7 7 месяцев назад +17

    Great content, will definitely keep your course in mind.

  • @mancio92M
    @mancio92M Год назад +9

    beautiful explanation

  • @siddharthpandey8516
    @siddharthpandey8516 Месяц назад

    Oh my what an amazing tutorial!

  • @mikhailterterov2018
    @mikhailterterov2018 8 месяцев назад +4

    Interesting video, thank you. But does the backtest interval include the one on which the model was calculated? Isn't it better to exclude the model time range?

    • @quantprogram
      @quantprogram  8 месяцев назад +6

      The backtest interval doesn’t include entirety of which the model is calculated. It includes some of it. But this should be done this way. One of biggest pitfalls in quant trading is curve fitting or over optimized results. So we need to perform our strategy on testing data which the model was not covered to see it efficacy. It’s also called forward testing. Real trading is theoretically forward testing.
      Let’s take an example of weather analysis. If we create a model to study the weather from 2000-2010 and see lots of interesting results using certain models, the only way we can validate the model is by running this model on data that’s outside of this time frame. Maybe 2010-2020. If it works then the model is good. If we run it on 2000-2010 it’s expected to do well because the model was created based on studying this period. Also the backtest has already confirmed that success of the model, hence the term "back"test. We are just getting curve fitted results. This is why forward testing or testing data is very important in not only trading field but all kinds of data science and machine learning models. We can go deeper to see if it works during specific black swan events as well to study deeper how our mode works

  • @konrad2411
    @konrad2411 5 месяцев назад +4

    Ok, i'm gonna be a quant, you convinced me. Gratest video of all times.

  • @marktilberg
    @marktilberg 4 дня назад +4

    RIP Legend ❤

    • @coloneltoad6341
      @coloneltoad6341 3 дня назад +2

      He lived a long and prosperous life. He inspired many. Me included.

    • @marktilberg
      @marktilberg 3 дня назад

      @@coloneltoad6341 hasn't been so long since I'd dreamt of meet him atleast for once in person , His legacy will remain forever .

  • @precioslouzado8651
    @precioslouzado8651 7 месяцев назад

    Does the enrollment to the cpirse come with the complete ML model

  • @digitalnomad2196
    @digitalnomad2196 4 месяца назад

    Great video, is there a video on the mean reversion strategy ?!

  • @parkerhenry1987
    @parkerhenry1987 5 месяцев назад +14

    It’s cool to notice that this mean reverting strategy looks to be performing better under higher volatility conditions.

    • @u2b83
      @u2b83 2 месяца назад

      Well yeah, because high vola causes overshoot, which then reverts to mean, so you bank bigger moves. The trick is to hedge with a matching, equal and opposite short, so that you effectively "sell volatility" (when you mean-revert both the long and short side). Then you just wait for it to go back down and cash out both(paired) long and short. Vola going down will always happen. This pairing is a way to not have to pay decaying premium. However shorting does incur premium. Note: paste my comment into GPT4 and it will explain the trading tactics in detail.

  • @gamuchiraindawana2827
    @gamuchiraindawana2827 9 дней назад

    Beautiful work.
    Now we as your audience can help optimise the code and share findings.
    For example there is no need to calculate up_to_up and then calculate up_to_down, simple statistics allows us to perform this instead Probability(up_to_down) = 1 - Prob(up_to_up). So if you calculate one, you know the other. Bayesian statistics.

  • @yvonnelye3366
    @yvonnelye3366 3 месяца назад

    I have watched a few of your videos and tested some of the samples. It's eye-opening for me to see how a quantitative trading strategy can enhance my trading skills just by analyzing the charts. As a result, I have subscribed to your channel. I am now interested in purchasing your Prometheus Contents course. I was wondering if you have a private support group channel for your students where they can seek clarification about the course content instead of waiting for an email response?

  • @Hamromerochannel
    @Hamromerochannel 7 месяцев назад +2

    Tried to learn about quant but it always felt like the word “rocket science” for the normal every day joe. But now my maths done with e.g here (Markov and stochastic models), coding done ( r, python, mat lab), and also fair bit of trading history, it was a piece of cake.

    • @itooflemma
      @itooflemma 6 месяцев назад

      I mean personally speaking as a profesional buy-side quant (also worked in sell-side) this is just a very small snippet from undergrad level 1st year.

    • @Hamromerochannel
      @Hamromerochannel 6 месяцев назад

      Yes it is but we cannot ignore one has to come across all this multiple discipline and be comfortable with it - does not matter the level you are at. For average Joe, it is an unlikely path to have covered all of those discipline no matter 1st year or at phd level. This becomes a problem to get your foot at being or trying to become a quant.

    • @jackson2991
      @jackson2991 5 месяцев назад +5

      @@itooflemma What ducking undergrad did you go to where you learned about stochastic processes as a freshman? I don't think that's true

  • @majorkuntz
    @majorkuntz Месяц назад

    Great video. Thank you.

  • @NishantChoudharyJi
    @NishantChoudharyJi 7 месяцев назад +3

    Incredible explanation about the most powerful strategies of Most successful trader of the world 🌎

  • @sanjayparekh2886
    @sanjayparekh2886 7 месяцев назад +5

    Very sincerely explained.

    • @quantprogram
      @quantprogram  7 месяцев назад

      Thanks much. Glad it was helpful!

  • @sinajberg
    @sinajberg 6 месяцев назад +6

    Thank you for the insightful video. It explains Markov principle clearly.
    Theoretically we can build chains of conditions that deliver profits quite easily.
    How do you avoid data mining and distinguish signal from the noise?

    • @VOLightPortal
      @VOLightPortal 6 месяцев назад

      Statistical significance tests and robustness checks, out of sample forward tests, ensuring other conditions are kept constant i.e. stop loss and take profit levels. Number of parameters for adjusting/tweaking should be no more than one per run to keep to a controlled experiment.
      "It is easy for trading system developers to be fooled by randomness especially when the underline process that is used for discovering the trading systems is in itself inherently random. Out-of-sample testing is not enough to guarantee statistical significance of any results obtained because large enough output sets will always contain in-sample results that also validate well in out-of-sample by chance alone. A way of minimizing the probability that machine designed trading systems are not random results is through careful and relevant portfolio backtesting.
      Cross-validation of data-mining results is the most important step in the process of discovering trading systems but it is also one that is the least understood. If a trading system does not pass an out-of-sample test then it can be discarded but if it does that is not sufficient for it being non-random. I would like to emphasize this point because system developers can become the victims of such misunderstandings. Specifically, if the performance of a trading system validates in the out-of-sample then this means that the system performed well in that specific out-of-sample. This tells us not much about future performance as conditions may change in the future. The term conditions is the key here. The more conditions that the out-of-sample contains from the set of all possible future conditions, the better the performance of the trading system will be in the future after it validates. However, typical out-of-sample periods reflect only a small subset of the conditions that can emerge in the future. One way of mitigating this highly negative effect on trading system development is by the use of a portfolio backtest.
      A portfolio backtest involves testing a trading system across multiple markets and calculating some key parameters that determine if the system was overall profitable. This is not a test over multiple out-of-samples but across multiple histories. Thus, it is a very strict test and it can also turn out to be a conservative one."
      - Michael Harris

    • @abhirajpawar2436
      @abhirajpawar2436 4 месяца назад

      any answers mate ?

  • @HenningPhysics
    @HenningPhysics 16 дней назад

    Very well explained the Markov models. It was just not totally clear for me: did you take any out-of-sample test (after backtesting)?

  • @Hshjshshjsj72727
    @Hshjshshjsj72727 21 день назад

    Super cool, subscribed. Some guy won the abel award in math for stochastic predictions of randomness, is that also helpful and do you have a video link for that

  • @PooyaZemi
    @PooyaZemi 4 месяца назад +1

    Markov Decision Process (MDP) must satisfy Markov property which states as follows: the action taken at each sate is independent of tall previous states resulting in current state.

    • @quantprogram
      @quantprogram  4 месяца назад

      thats exactly whats explained in the video

  • @CrazyWatcher670
    @CrazyWatcher670 7 месяцев назад

    Thank you sir 🙏🏻

  • @warmwestwind
    @warmwestwind Месяц назад +2

    a youtuber who actually reads books ;___; finally I'm home

    • @warmwestwind
      @warmwestwind Месяц назад

      I'm competent with Python but all the financial instruments are still Greek to me BUT Joe Biden recently celebrated the Greek independence day, and I'm taking careful notes on that kind of thing now.

    • @warmwestwind
      @warmwestwind Месяц назад

      protip: the sign language interpreter that whitehouse.gov provides for the Deaf community also conveys a lot of really crucial subtext not explicitly noted in the event transcripts. This is broadly true for all White House events, and there are definitely Easter eggs hidden in there.

    • @warmwestwind
      @warmwestwind Месяц назад

      Whatever the archbishop said got a healthy laugh, so that's a good sign

  • @UsefulMotivation365
    @UsefulMotivation365 6 месяцев назад +3

    I'm just asking because I don't know how tradingview works in this area, but, are you splitting your data in a training set and a execution set? Because if you aren't doing that, you are going to have great results because you are overfitting your data. Or, in other words, aren't you using the same data to obtain the probabilities than the data that you use to do the operations?

    • @quantprogram
      @quantprogram  6 месяцев назад

      You’re right. In any quant analysis importance should be given in splitting the data to training and test data. I normally mention this and to do forward testing in all my videos as you’ll see in my previous videos and in the quant trading course. I totally forgot to mention it in this video. I guess my focus was totally on letting the views understand what Markov process was and during that juncture totally forgot mentioning the data splits. My apologies regarding the same.

  • @pauleasther
    @pauleasther 9 месяцев назад +3

    Great work 😊

  • @janalgos
    @janalgos 7 месяцев назад +4

    If we join the program do you provide the source code for the strategies?

    • @quantprogram
      @quantprogram  7 месяцев назад +1

      We do provide the codes for the strategies that’s on the course

  • @robrm100
    @robrm100 22 дня назад

    should it be .shift(1) instead of .shift(-1) since we are moving from a current state to the next state?

  • @stefanodadalt
    @stefanodadalt 7 месяцев назад

    where to find this system?

  • @W4D199
    @W4D199 7 месяцев назад

    What about its comparison with TTM Squeeze strategy???😮😮

  • @amiralamir9984
    @amiralamir9984 4 месяца назад

    Just a question, did you “train” (calculating probabilities) the model with the same data that you traded with?

    • @quantprogram
      @quantprogram  4 месяца назад +1

      I normally talk about splitting test data and do forward test in all my videos but I completely forgot about mentioning it in this video. The whole idea of the video was just for the viewers to understand what Markov process was so I didn’t focus on that specific part.
      If you can watch my other videos you’ll see me talk about curve fitting and doing forward testing and Monte Carlo simulation. My apologies in missing that part in this video

  • @placebo64
    @placebo64 7 месяцев назад +1

    Interesting! Thanks for sharing. 🙂

  • @krissn8111
    @krissn8111 7 месяцев назад +3

    Good way to come up with new strategies but as you said we may need to combine multiple strategies to be profitable.

  • @jerkan7
    @jerkan7 6 месяцев назад

    when you calculate the chances of an up day after 5 down days, why do you select forward days (.shift(positive)) on the divisor?

    • @quantprogram
      @quantprogram  6 месяцев назад +2

      Because we are looking for any continuous instance of 5 down days in the denominator. Note the word "any". If we find 1 we save it as 1, if we find 10 of them then total number is 10. Thats why we used "len". ie We need the data for all consecutive 5 down days. As compared to the numerator where we are looking for an up day but the previous 5 days are all down days, hence the use of -ve in the numerator. Once we get that we can divide each and calculate the probability which in this case is 66%. Hope you got the gist.

    • @jerkan7
      @jerkan7 5 месяцев назад

      @@quantprogram I've played with you code and I think there's an error. When you try to select the up days with previous 5 down days, you shift negatively which looks into the future.

    • @quantprogram
      @quantprogram  5 месяцев назад +2

      @jerkan7 Youve completely misunderstood the code mate, the shift moves a row upward. I know is super confusing, because of the dates. This is very common with time series analysis. It’s hard to explain the code.
      Type these two lines of code after all the codes and youll understand.
      1. data[data["state"] == "up"]
      2.data[data["state"].shift(-1) == "up"]
      youll see for the first code the result for the last day is 2022-04-19, for the second it is 2022-04-18. so by shifting ie shift(-1) you're getting the previous days data, not the future date.
      So we are looking the current day is up and the previous day is up(or whatever you intend) by using shift(-1), Hope you understood now

  • @mbuhhh3605
    @mbuhhh3605 9 месяцев назад +2

    Very informative

  • @mugishafredrick5499
    @mugishafredrick5499 7 месяцев назад

    What timeframe does markov trading work best?

    • @justins5756
      @justins5756 5 месяцев назад +1

      If they told us they would have to make a new one up

  • @michaelc730
    @michaelc730 4 месяца назад +1

    Don't you have a data-mining bias/problem, if you play with the combination of days until you get a good result? That's curve fitting the historical data, no? Also, it seems to me the testing is done in-sample, where your test results are derived from the same data as the data to test and pick the strategy days, please clarify if I misunderstand. thanks.

    • @quantprogram
      @quantprogram  4 месяца назад +1

      Yes you’re 100% right. I normally talk about splitting test data and do forward test in all my videos but I completely forgot about mentioning it in this video. The whole idea of the video was just for the viewers to understand what Markov process was so I didn’t focus on that specific part. If you can watch my other videos you’ll see me talk about curve fitting and doing forward testing and Monte Carlo simulation. My apologies in missing that part in this video

  • @MaksUsanin
    @MaksUsanin 4 месяца назад

    Hello, would you suggest pls the comfortable way to automatically trade if my broker IB ? any platform ...

  • @Larsykfz303
    @Larsykfz303 Месяц назад

    Question: At some point it is stated that Markov chains do not care about what the history of states or the previous state was, but I feel like this is contradicted by then showing a model where we check if the past 3 days have been loss days. What am I not understanding? Do we consider "4 days of consecutive loss" to be a single state?

    • @quantprogram
      @quantprogram  Месяц назад +1

      In Markov process future state only depends on current state and has no memory of past states. The 4 consecutive days losses is taken as current state/single state in a markov model. This approach is a way to incorporate historical information while still adhering to markov property.

    • @Larsykfz303
      @Larsykfz303 Месяц назад

      @@quantprogramThank you very much for your response, I understand it now.

    • @quantprogram
      @quantprogram  Месяц назад

      @@Larsykfz303 Youre welcokme

  • @8smearlene850
    @8smearlene850 11 месяцев назад +2

    great video

  • @Larussiecestlavie
    @Larussiecestlavie 7 месяцев назад +2

    impressive content!

  • @Reddblue
    @Reddblue 5 месяцев назад

    I'm not so well invested in markov-chains but how well would it work when implemented with other strategies like macd/rsi crossovers or literally any other techincal indicators? From what I've learned, the markov chains only output the probability of a certain outcome right? Or am I missing or misunderstood something here?

    • @nikolajnq
      @nikolajnq 4 месяца назад

      @Reddblue it gives you probabilities of which you can base trades off. e.g. you know after 5 red days there is a 67% chance to be a green day, you would probably go long after 5 days. this by itself isn't the best thing to do though because you dont know where and if to put a sl, risks management etc etc. but it's a starting point. hope this explains it

    • @Reddblue
      @Reddblue 4 месяца назад

      @@nikolajnq if i may ask again, is it kind of similar to saying that if I flip a coin and it gives me 2 heads in a row, my probability that I will get tails next becomes significantly greater because I have the previous variables?

    • @nikolajnq
      @nikolajnq 4 месяца назад

      ​@@Reddblue no flipping a coin always stays a 50:50. i recommend you study some basic statistics to understand that basic. in trading the previous variables can change the upcoming ones. lets give an example. someone who just broke their arm is less likely to break it again the following day becuase they will be extremely cautious compared to someone who didnt break it the day before. i hope that example makes sense. and in trading it can kinda be the same.

    • @pkhaloobonaccio9883
      @pkhaloobonaccio9883 2 месяца назад

      ​@@ReddblueA coin flip gives you 50% change of either tails or head because of the law of large numbers . The theory states that as your experiments trials becomes large , the prob of the event happens converges(ie reaches zero) .
      Let's take an example of a casino, assume you have a strategy that make you money. You want to know what is the expected value of the payoff of your strategy, (i.e on average how much can you gain). By the law of large blabla , by a big margin it is going to be 50%.
      However, casino knows this , therefore they are going to rig the game in such a way it is no longer 50%. Furthermore , one thing we assume is that we are going to be solvent until we repeat the trial infinitely .(martingale).
      The same is for the stock market , because there people who also know your strategy , the probably cannot be equal to coin flip

  • @CK-zp8tx
    @CK-zp8tx 5 дней назад

    what high school and later on college math courses will help students learn Markov Probabilities and other quant strategies?

    • @quantprogram
      @quantprogram  4 дня назад

      Linear algebra, calculus and statistics will help. But ideally you will want a masters in risk management and or financial engineering

  • @poxeddos
    @poxeddos 5 месяцев назад

    Great explanation, I found one thing puzzling though. The five consecutive down days condition is not really markovian so to speak, right? To calculate the probability there we need to (obviously) look into the past, not only the current state.

    • @quantprogram
      @quantprogram  5 месяцев назад

      Yes and No. It is markovian because of the sequence of the event that came to the current state, so in this case the past x days contributed to the current state.

  • @Juoa794
    @Juoa794 8 месяцев назад +2

    What commissions and slippage did you build into the TradingView backtest?

    • @quantprogram
      @quantprogram  8 месяцев назад

      I use a zero commission broker so there was no need to add the commissions section. You can add it if you broker does have commissions. For interactive brokers commissions fixed range for non-us residents the total return goes down to 1100%. The strategy is now in 1345% since posting the video. This is without any leverage. If you use leverage or trade in E-mini the returns could be much higher. Since the drawdowns are quite small for this strategy there is room for leverage if you can handle the volatility. Slippage is a massive issue if you trade intra day because of the number of trades but for overnight it generally cancels out due to positive slippage unless your account size is in millions. We don't do any intra day strategy nor do recommend creating algos for intra day timeframe. As you can see since inception of SPY the number of trades is just 700+ for the strategy discussed. Recently we had a massive positive slippage in our favor in the NVIDIA trade because it gapped up. We discussed that on or NVIDIA posted 3 months ago. However you do need to keep a tab on MAE and MFE on the strategy and see whether your strategy is efficient and also perform Monte Carlo tests. This can give you heads up on if slippage could be an issue.

    • @jerryware1970
      @jerryware1970 8 месяцев назад +1

      Renaissance Technologies were member firms on most exchanges reducing costs and dealers as well…having a very low cost basis. They also invested in high speed and computing infrastructure forty years ago giving them advantages. And I imagine their tax efficiency of fund structures and the trades themselves are optimized. Anything to maximize profits has been thought out. They quantified the theoretical value of every financial instrument and traded it.

    • @quantprogram
      @quantprogram  8 месяцев назад

      @@jerryware1970 You're absolutely correct. They must have thought of all these and more to squeeze every penny from the market. With the amount of trades they do, they have to do all this

  • @carlosmartin1978
    @carlosmartin1978 4 месяца назад

    So you are using todays data to predict the next day, but the probability values are found out by historical data. So it is kind of present day prediction right. Great vídeo btw

  • @aleipiano
    @aleipiano 2 месяца назад

    I think you inverted down_to_up with up_to_down in the transition matrix. Isn't it? I'm not sure if the element with row up and column down is equal to the variable up_to_down. Maybe you thought that shift(-1) considerates the previous data, but it considerates the subsequent one instead

    • @quantprogram
      @quantprogram  2 месяца назад +1

      I think I am right ill have to look into it. As dates are put in a such a way that last row is the latest date. Also shift is for moving row, it doesn't move the column. if the codes results was wrong the strategy results should also be negative, which it isnt, if you know what i mean. Initial look seems good but Ill have a deeper look at later it though.

    • @aleipiano
      @aleipiano 2 месяца назад

      @quantprogram Ok, it's just because trying to copy your code I noticed that the variable up_to_down was different respect to the element with row up and column down. Another question: the sum of the elements of the same row is 1, but why isn't the same for the elements in the same column? I think this is correct, but I don't know the reason behind it: after all, also the probability that before (instead of after) a + there is a + and the probability that before a + there is a - should sum to 1 in my opinion

    • @quantprogram
      @quantprogram  2 месяца назад +1

      @@aleipiano the sum of the columns will never be one as it doesn represent total probability of transitioning to a state from all other states. The row must sum to 1 because the probabilities in a row represent all possible outcomes for the next state from a given current state. The columns represent the likelihood of arriving at a state from each possible preceding state, but these are independent scenarios. Hope you got tthe gist

    • @aleipiano
      @aleipiano 2 месяца назад

      @@quantprogram Ok thank you, I think it's a bit more clear

  • @hamzakhan4139
    @hamzakhan4139 Год назад +1

    Great content, can you show us, how does this mean reverting strategy perform in crypto market ?

    • @quantprogram
      @quantprogram  Год назад +4

      Thanks for the comment mate. From my studies, crypto doesn't seem to do well in mean reverting strategies. But trend following and momentum works well in crypto. Also if its long only. The other issue is all with lack of enough data with crypto as compared to stocks

  • @leiyuchen
    @leiyuchen 7 месяцев назад

    good

  • @nula9819
    @nula9819 Год назад +2

    thanks for your great video! but I tried to backtest the code, and the buy signal is delayed and cannot use for the actual trading signal, as it appears afterward...

    • @quantprogram
      @quantprogram  Год назад +1

      I don’t understand. Delayed how? You will only get the signal at the bar opening because only if the previous bar closes the data can be checked. So If I say previous bar close should be lower than day before close. I’ll only get the signal after the previous bar is closed. You can’t expect to get signal before that. You can’t get all data of yesterday weather until 12 midnight. Then the next day opening you get the signal. That’s literally 12am or when the market opens. The first second. Then you make the trade so I really don’t get it where you get the delay

    • @nula9819
      @nula9819 Год назад +1

      @@quantprogram thanks for your reply! Yes, but when I used the playback function on tradingview, the signal appear after today bar closed, that what I mean delay. And because of this, I only can make trade after 1 bar of the signal appear, it will affect the risk and reward even the winrate. Hope I can express it clearly ;) thanks!

    • @quantprogram
      @quantprogram  Год назад +6

      @NULA Oh i got it now, The playback function is useless, to test these things you have to set a time settings in playback(10x, 0.5x) which conflicts with both the signals and printing of the signal as theres no time to print it. The bar is printed fully in playback in one go as compared to real life. In real life eg. it takes an entire 5 minute(or 1 day) to print the bar. Within the fist second of the bar printing the signal is generated. While in playback the bar is fully printed immediately, hence the delayed signal
      In playback the priority is given for the playback not execution of strategies or indicators. The playback can't imitate a whole bar as its created. It can only immitate 1 full bar in 1 go hence the delay. If you actually use any strategy in real time you would have seen that signal comes in the day open or bar open within the first second, so you can use the signal to trade. I have been doing it for many years. So basically if a person is entering trades in a daily or a 1 hour or even shorter time frames there is barely any delay. Unless you are trading in 1 second chart frame and signals are based on 1 charts. I suggest you personally try it real time and you will see theres barely any delay

    • @nula9819
      @nula9819 Год назад

      @@quantprogram love it! Will try it again thanks!!

    • @quantprogram
      @quantprogram  Год назад

      @@nula9819 You're welcome mate

  • @MM-et8hw
    @MM-et8hw Месяц назад

    mt4/mt5 indicator ? All the best.

  • @rshoemake
    @rshoemake 7 месяцев назад +2

    Thanks!

    • @quantprogram
      @quantprogram  7 месяцев назад +1

      Thanks much mate. Appreciate it

  • @kwekuodum7271
    @kwekuodum7271 7 месяцев назад +1

    Can I use quant methods to trade a prop firm account?

    • @quantprogram
      @quantprogram  7 месяцев назад +1

      Depends on what kind of proprietary trading firm. If its a genuine prop firm then its ok. But if its like those dodgy prop firms than asks to pay money for each try and have unreasonable results demand then no.Its better off you stay away from dodgy prop firms. My best bet would be to learn quant trading thoroughly and apply to quant based hedge fund either as a quant developer or quant trader, junior or intern positions

  • @saneworld9418
    @saneworld9418 7 месяцев назад

    Thanks

  • @jody6851
    @jody6851 7 месяцев назад

    If Markov chains are based on the now and not the past, then why would you care about past data one way or the other? Also, why do you assume the market has to do anything on any particular day? Maybe it'll consolidate and stagnate in a very tight trading range. Just like the guy who is supposed to choose between shopping and work starting at home, maybe he decides he'll just go to work and skip shopping. Or maybe he'll even decide to simply stay home and chill out and not do anything. No?

    • @quantprogram
      @quantprogram  7 месяцев назад +5

      No, you didn't understand the process thoroughly. When now is done we have already achieved the result. ie the data. When i reach the shop, the data is already recorded that i am in the shop. When the market closes yesterday and todays trading day is yet to be started we have already recorded the result of where we are in the case the close of the trading day.
      With regards to your second statement, just as explained in the video, markov model doesn't know the past. Humans know it they came form where and can decide to skip shopping or chill at home, or any other thing, they can make that decision. Markov only makes the decision based on the current data, it calculates the probabilities of either situation taking the data in multiple situations before. Based on this info we calculate the probabilities based on a high amount of data. In humans the probabilities are corrupted because of maybe they want to "chill at home" ie in this case bias. These are all clearly mentioned in the video,

  • @aidens6122
    @aidens6122 7 месяцев назад

    Whats the name of the book? Link takes me to some arabic amazon link cant read it

    • @quantprogram
      @quantprogram  7 месяцев назад

      It’s mentioned in the video at 0:41

  • @dan.franco
    @dan.franco 6 месяцев назад

    Beautiful

  • @AlSteve7
    @AlSteve7 7 месяцев назад

    Does it mean with this markov method we will get 100% probability?

    • @quantprogram
      @quantprogram  7 месяцев назад

      No . In fact video doesn't discuss anything about 100% probability. Dont know how you came into that conclusion

  • @saywhat4229
    @saywhat4229 6 месяцев назад

    I wasn't able to see the whole code for line 26 . Could you please share that line?

    • @saywhat4229
      @saywhat4229 6 месяцев назад

      5 down days in a row

    • @quantprogram
      @quantprogram  6 месяцев назад

      you can download the code from the link in the description. Once you opt in , it will be send to your email

  • @rolandowijayas7387
    @rolandowijayas7387 10 месяцев назад

    i curious how that look on forex market

    • @mbuhhh3605
      @mbuhhh3605 9 месяцев назад

      It should works equally well. Just one important thing, do note that some pairs change states (mean rev or trending) in different durations, i mean adjust the length of the up or down periods for the matrix, if you adjust it correctly depending on the pairs it should do well

  • @NeerajKumar-gk9kz
    @NeerajKumar-gk9kz 5 месяцев назад

    Why you choose pythons if anyone choose c++

  • @NasdaqSniper_
    @NasdaqSniper_ 26 дней назад

    My fund can outperform his any day.

  • @vikraal6974
    @vikraal6974 25 дней назад

    The true secret is the fact that he is applying Game Theory to Markov Chains

  • @1ndraNugraha
    @1ndraNugraha 8 месяцев назад

    Where is the code for MT 5?

    • @quantprogram
      @quantprogram  8 месяцев назад

      There is no code for MT5 described in the video. This is Python.

  • @itshenryhunt
    @itshenryhunt 6 месяцев назад +4

    I think people over complicate trading. I'm not Jim Simons and don't bother with quant faff and somehow outperform his fund. I keep it simple. High probability set ups, risk: reward of at least 1:3. I win 65% of my trades and when you have a average win which is 3x of my average loss. You smart folk do the math.

    • @6ix_eyez
      @6ix_eyez 6 месяцев назад +1

      Any one can type that it doesn't make it true or false. Let folks lose so you can continue to win. It's a fairly efficient system if you ask me.

    • @IwinMahWay
      @IwinMahWay 5 месяцев назад +4

      Easy to say when you don't have to trade 10b usd

    • @pkhaloobonaccio9883
      @pkhaloobonaccio9883 2 месяца назад

      let's talk in geometric mean bro. I also can say my avg return is 25% if yesterday i made 100% and today i made -50%

    • @u2b83
      @u2b83 2 месяца назад +1

      I'll do one simpler: If you just held FNGU/TQQQ this year you could have passively made 10x ...that is your benchmark, otherwise you underperformed ;)

    • @itshenryhunt
      @itshenryhunt 2 месяца назад

      @@6ix_eyez I have stats to prove it. But your entitled to your opinion.

  • @innvestor4622
    @innvestor4622 5 месяцев назад

    Weird how his public funds produce average results but his private fund gets huge returns 🤔

    • @mushrifsaidin
      @mushrifsaidin Месяц назад

      Because the public funds are the diluted/delayed version of their private fund's algo. I don't have evidence to back this up though but I remember stumbling across an article a while ago of a team of researchers tracking and comparing the returns and trades made by both fund. They found out that the public funds place an almost similar trade but some are delayed/smaller/nonexistent compared to their private fund.

  • @kushalkoradia
    @kushalkoradia 7 месяцев назад

    Value

  • @zaidab9855
    @zaidab9855 8 месяцев назад +54

    Comparing a trader to Buffet doesn’t mean anything! Buffet may not even know what is future and options…

    • @quantprogram
      @quantprogram  8 месяцев назад +63

      Thats not true. Buffet knows very well about futures and options. In fact, he has sold multiple amounts of put options over the years in S&P 500 and stocks like Coca Cola. KO in 1993 and S&P 500 puts during the years 2004-2008+ financial crisis.
      There is no comparison to anybody. I just stated that purely from a fund performance SImons has outperformed Buffet. They all trade different products at different times and have different styles as explained by buffet himself in the beginning of the video. As the title suggest, the video is just about the Markov Process that Jim SImons uses not a comparative study between Simons and Buffet

    • @juanitoqueintin5908
      @juanitoqueintin5908 6 месяцев назад +33

      Relearn everything if you think buffet doesn’t know what future and options is

    • @user-nf7bl7mb5q
      @user-nf7bl7mb5q 6 месяцев назад +24

      This is the stu pidest comment I've read here

    • @user-hw8zy2wf8g
      @user-hw8zy2wf8g 4 месяца назад +1

      He knows.

    • @dennykeaton9701
      @dennykeaton9701 4 месяца назад +1

      He knows. He's sold many puts in his life

  • @W-HealthPianoExercises
    @W-HealthPianoExercises 6 месяцев назад

    Jim Simons, ma per favore... 🤭

  • @konradpsiuk5349
    @konradpsiuk5349 Год назад +3

    All cool but most of the time next day return is 50/50.

    • @quantprogram
      @quantprogram  Год назад

      Is that an opinion or a fact. If its a fact you have to prove it mathematically

    • @konradpsiuk5349
      @konradpsiuk5349 Год назад +6

      @@quantprogram I ran those models many times in the past but I honestly don’t have time to do it again so treat it as an opinion. One important aspect that is missing also is the size of the moves. The outcomes aren’t simply binary.

    • @quantprogram
      @quantprogram  Год назад +11

      @Konrad Psiuk Size of the move would be a volatility based model(Garch, stochastic, etc), not a markov model. Those are completely different things and serve different purposes. The video is an explanation of markov model. So i don't understand how "missing the size of the moves" applies here.Of course combining both can be done. but it depends on what you're trying to achieve from each model. Markov model is trying to figure out sequence of events using probability. It has nothing to do with volatility. The point of the video was just to talk about markov process and the trading ideas that can be generated. In markov we are trying to get the sequence probability, not the next day probability. An up day followed by another up day, etc. The word sequence is quite imperative here.
      The expression "most of the time next day return is 50/50" is quite confusing and subjective, hence my request for mathematical proof. If you mean next day return is either + or -, absolutely, it has to be, those are the only two outcomes that can happen. If you mean the actual return is identical on both sides on average, thats not true. A simple distribution graph of returns code of 4 lines or so should prove it. I don't know if you meant something else either. I would be curious on how your model was done proving that the returns are "50/50", the data, stocks and the time frame used. If you have any research papers from someone to back it up, i would like to read that too. I am not aware of some paper like that but if there is I would like to improve my knowledge on that.

    • @quantprogram
      @quantprogram  10 месяцев назад

      @aady1985 Its difficult to account for % move, even if we did it will be pointless as the result cant be trusted. We can however predict the volatility and hence fro the ranges using stochastic model. The more we go to find out the perfect characteristics of a trading day the less probabilistic outcomes we get. Eg. its easy to predict whether a specific days weather will be sunny or rainy but extremely difficult to predict the temperature at a particular second. By difficult i mean the probability to be correct

    • @quantprogram
      @quantprogram  10 месяцев назад +2

      @aady1985 ATR is a derivative of volatility, more of a simplistic model. We can use weekly or monthly data but again, then the issue comes with fewer data that we can rely out to trust the model.
      From my personal experience rather than finding 1 bullet proof strategy, use many, atleast 5. Each handling different methods and different models. We can put in different timeframes or even different products, like you mentioned before going for spreads or sell outright far away puts.This should give a more smoother equity curve. Its very common in quantitative space where new quants try to find that single strategy rather than having a multiple of simple models that will do far better.

  • @Birobrata_Deb
    @Birobrata_Deb 6 месяцев назад

    test

  • @user-ub9ff5os6q
    @user-ub9ff5os6q 3 месяца назад

    nice