Harmonic Pattern Recognition With Python

Поделиться
HTML-код
  • Опубликовано: 24 апр 2023
  • In this video I show python code for pattern recognition of Harmonic Patterns. The code shown finds the Gartley, Bat, Butterfly, Crab, Deep Crab, Cypher, and Shark Harmonic Patterns. These are all XABCD patterns. The code is able to find any other XABCD pattern given the ratios. We backtest the harmonic patterns using hourly bitcoin data.
    Chart Pattern Algorithms (directional change): • 3 Must-Know Algorithms...
    Full Code: github.com/neurotrader888/Tec...
    Patreon: / neurotrader
    Links
    en.wikipedia.org/wiki/Golden_...
    en.wikipedia.org/wiki/Fibonac...
    The content covered on this channel is NOT to be considered as any financial or investment advice. Past results are not necessarily indicative of future results. This content is purely for education/entertainment.

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

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

    Your upload schedule is on point

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

    Great video on Python trading!

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

    very nice , as always , dude i am fan of your work

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

    i want to say that this is some well written code and it is very accurate. I have generated all patterns detected in the btc csv file and am doing well so far. am working on a machine learning project to detect patterns and predict direction and possible stop points

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

      Im doing the same thing right now. Im data scientist. Can you tell me how you did the feature engenieering?

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

      What results?

  • @Chainerlt
    @Chainerlt Год назад +5

    Proving astrology is... astrology! Anyway amazing work! I'd like to see more performance evaluation metrics on results: sharpe, sortino and etc. since profit factor is very one-dimensional.

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

      I can start showing more metrics, but I respectfully disagree. In my experience, the profit factor has some of the least bias. Often yielding better results for out of sample use (don't be dissuaded by its simplicity). It is my favorite criterion along with the martin ratio. As the amount of data used increases the performance criterion used tends to matter less.
      I may make a video comparing different performance criterion's training bias in the future.

    • @hopp.to-bst
      @hopp.to-bst Год назад +1

      by the way you can use "Héron formula" to value the triangles ( you have many triangles in this harmonious paterns methos you provided here )

  • @Jonathan-ob9rz
    @Jonathan-ob9rz Год назад +1

    Hello..many thanks for such educational videos...do these patterns apply to binary option trading platform?

  • @BlackPanther-hs5or
    @BlackPanther-hs5or 4 месяца назад

    How do feel about G.W. Gann methods?

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

    can u do the "dragon" and "black swan" and "white swan" and even the more hidden "wolfe" harmonic pattern?

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

      I've never heard of any of these, I'll take a look. I know of wolfe waves. Whenever I return (some day but not today), I'll be making a video about wolfe waves.

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

    Have you ever considered researching academic papers to build strategies?

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

    imo you write your code in such a way that simply using numba will probably help increase the performance greatly without changing too much of the code itself

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

      Interesting, I'll look into that. Most my coding experience is with C++, and it probably shows. My python isn't very "pythonic"

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

    Looking forward in watching this video , neurotrader can you implement metalabelling on a simple strategy please

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

      Yes. Great idea, and an important topic. I'll make video about this soon.

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

      @@neurotrader888 when you make one regarding metabelling in the future, if possible, can you also explain the differences between adjusting signal threshold of the primary model/signal and metalabelling.
      By that I mean most of the strategies existed today often comes with parameters to set. what are the result differences between 'Optimizing the params' and training a metalabel model to judge the primary signal.
      Or another example would be a primary model itself could be a simple ML model trained with MACD signals.
      What are the differences between 'adjusting the decision threshold' of the primary model verses using metalabelling.
      thanks a lot.

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

      @@playeryin Roughly speaking. The primary model typically seeks to maximize recall. While the meta model seeks to maximize precision.It's difficult to prioritize both of these with one model. The combination of both typically improves the F1 score. But there is quite a bit more to say. I'll try to think of a good ways to explain.
      en.wikipedia.org/wiki/Confusion_matrix

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

      @@neurotrader888 First of all, thanks for you reply. I understand what you are saying.
      The first model is to maximize signal occurrence, regardless of the True or False. And meta would try to filter out False signals.
      but let say the primary model is also a ML model, supervised trained, that has a last neuron using softmax as activation to give buy signal. typically > 0.5 yield to buy signal.
      we could adjust the the buy signal threshold to > 0.7 to yield less signal in general, and probably left with more accurate signal.
      so the first time I mentioned metalabelling to my friend, he asked me how useful could metalabelling be while he could just adjust the threshold of the primary model? potentially leading to the same goal.
      I didn't know the answer to that lol.

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

      @@playeryin Ok I get you, I've wondered the same thing. Continuing with your softmax example..
      If the primary model is concerned with learning the side to trade. (Deciding whether to long or short). The primary model's recall will be maximized with a decision threshold of 0.5. Above 0.5 go long, below 0.5 go short. In my experience the features (model inputs) predictive of a successful long prediction are often different from the features predictive of a successful short prediction. Long and short asymmetry. The meta models accounts for the long/short asymmetries that the primary model misses, as the primary model is focused on learning whether to long or short.
      But because the mentioned asymmetry, I usually build models that are specialized for a single side. A model that learns long trade setups for example. When doing this I've found it effective to optimize the decision threshold (achieving the same goal as meta labeling with less complexity). The extreme values of a model's output (and indicators) are almost always the most predictive. I have tried meta-labeling models on top of a side specialized model but have never found it effective.
      I've mainly found meta labeling effective when the primary model is not a machine learning model. But rather a defined trading rule. Price crossing above some line, MACD, etc..
      This topic is pretty in the weeds and I probably won't cover this in a meta labeling video. Hopefully this answers at least part of your question. Someone more knowledgeable than me may disagree with what I said. I'm just saying what I've experienced. Your mileage may vary.

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

    I tried with 400 rows, and there were 8 patterns detected, one of which was found in rows 320 to 372. However, when I tried with the tail(100), that pattern was not detected. Thank you for your response.

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

      The directional change algo needs sufficient data to "warm-up". It can be unstable at the very beginning of the data. The pattern may be from 320-372, but it needs data prior to that for the detection to work.

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

      Thank you. How can I make this 10:06 pattern appear in the last row or in the last 2 rows?
      n how to replace 2% to 0.1 % at 10:22

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

    Can you test the methods outlined in the book "Complete Stock Market Trading And Forecasting Course" by Michael Jenkins? It uses Geometric Methods and Gann techniques and someone on Reddit claimed to have made a lot of money using it on BTC in various timeframes.

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

      I'm not familiar with that book. While it is usually not effective, I do enjoy automating subjective trading tools. I'll take a look, if the method is not too vague I'll give it a shot. Never trust a redditor :)

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

    I wouldnt conclude anything
    - optimize zigzag retracement ratio
    - try out different exit rules
    These two can drastically change the result

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

    For my whole life, I always thought Chart Patterns are subjective discretionary BS, until I saw this video!

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

    Wayyyyyyyyyyyyy too intelligent! This shouldn’t free. #GodLevels! Can you do videos on convex optimization algorithms please!!!

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

      Maybe, the only convex optimization I use regularly is least squared. Usually doing a SVD. I used to use quadratic programming for Markowitz style portfolio optimization, but I've never found it effective out of sample.

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

    I have a whole system of fib trading that is based on 0.618 and I have seen serious accuracy in indian equity markets. The only thing is it is manual and I want to automate it. We can discuss about it if you are interested do reply !.

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

    Can you help find an upcoming Harmonic Pattern or a pattern that's just been made with this algorithm?

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

      This program finds the harmonic patterns as they are made. Earlier detection could be done with modification, checking ratios not including the D point in the XABCD patterns.

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

      @@neurotrader888 i tried implementing this code into my algorithm as a test but wasn’t able to do that successfully. Can we connect? Can you share your email?

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

    Is there any way we can plot that on chart as well ?

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

      replace
      data = ohlc.iloc[pat.X - pad: pat.D + 1 + pad]
      to :
      data = ohlc

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

    if you can make strategy about volume☺☺☺

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

      I will eventually. Volume is pretty tricky. It often has a non-linear relationship with price (if any relationship). I have a half-way done video inspired by the Wyckoff effort-result rule. It still feels like its missing something though, so I'll publish it once I iron it out.

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

    can you do a Elliot wave strategy

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

      Maybe in the future. Elliot wave stuff is usually pretty vague. Hard to automate. But I've seen a few papers attempting to automate parts of the theory. Never tried them though

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

      Trading view is doing that in case that helps

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

    The self fulfilling prophecy explanation doesn't explain why Fibs also work on non tradeable charts like BTC dominance or DXY.

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

      Interesting, I'll try the retracement script on dominance/dxy when I get a chance. Would be weird to see fib ratios on a non-tradeable.

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

    Dude, goldbach

  • @3702251a
    @3702251a Год назад

    It’s funny that you don’t know WHY Fibonacci ratios work.

    • @neurotrader888
      @neurotrader888  Год назад +7

      In trading we're always left in the dark. I do not know (with 100% confidence) why any strategy works. I can use statistics to gain confidence, but at the end of the day I can only theorize.