Market Profile and Support/Resistance Levels With Python

Поделиться
HTML-код
  • Опубликовано: 29 июн 2024
  • In this video I show python code to create the market profile with a kernel density estimate (a.k.a Parzen window). We find and filter peaks of the market profile using prominence to extract support and resistance levels. The code has customizable time weighting to allow for quicker identification of the levels for real time use. I show a simple trend following strategy that buys on the penetration of the levels with decent performance. This tool can be used to implement algorithmic trading strategies that require current support/resistance levels.
    Patreon: / neurotrader
    Links
    Full Code found in mp_support_resist.py : github.com/neurotrader888/Tec...
    Prominence Scipy: docs.scipy.org/doc/scipy/refe...
    Prominence Wikipedia: en.wikipedia.org/wiki/Topogra...
    Parzen Window:
    en.wikipedia.org/wiki/Kernel_...
    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.

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

  • @snay6869
    @snay6869 3 месяца назад +10

    you are one of the rarest few that actually know what they're doing

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

    This just blew my mind, and is going to help my current trading algorithm immensely.

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

    Another video and another gold infos . I have been following your contents for a while now and its has reallt helped me with my project.
    As always im thankful for these valuable informations.❤

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

    Nice! Can’t wait to see it

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

    In my opinion, we can add dynamic atr instead of passing a single atr number (of the last candle) to the function. In a range market, ATR is much less than a trending market and this would help to enhance the algo. In overall, I am really impressed. Thanks for sharing that!

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

    thankful for these valuable videos.

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

    Thats awesome..
    Your key levels work kind of like a Donchian Channel

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

    Very informative video 👍

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

    Thank you. This is amazing!

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

    Recently found your channel and really enjoying watching your videos and explanations. This is definitely a question from a noob, but I was wondering why store min and max price in a numpy array rather than a dataframe?

  • @asdkjfhasfighasdfjha
    @asdkjfhasfighasdfjha 11 месяцев назад

    awesome!

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

    Respect!

  • @bangsun1585
    @bangsun1585 11 месяцев назад +4

    Great video! But I wonder if you can show me the code for the live matplotlib drawing at the start of the video?

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

    looks great but IMO some of those levels can show up just because of periods of low volatility, not necessary meaning that it is a S/R level

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

    could you maybe do a machine learning video on this volume profile example to determine the best parameters for the trading strategy? on second thought, maybe even combine with your another example with the bull/bear flag(trendline version): i.e. 1.when the trendline and vol. profile being broken at the same time and then trade; 2. train the model so to find the best fit for this strategy. thanks a lot for the valuable content!!! best wishes,

  • @Bookmaper-fu7sc
    @Bookmaper-fu7sc 4 месяца назад

    @neurotrader Great content, could you help understand how do you have initial 10 min of animated left side profile with support and resistance? thanks in advance!

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

    Great work bro, I really appreciate your hard work. I have a question, which is the best technique to find support and resistance?

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

      I don't think there is a best. I've tried several different techniques for various applications. Some perform better/worse depending on the application.

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

    we could use volume along side with time to compute the weight.

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

    man you are on another league of algo trading. Im interested in your visualizing techniques and hope to see them in separate video.

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

      All my videos are visualizations are done with matplotlib. I might make a video showing some common ways to visualize things, but I'm looking to upgrade how I do visualizations now as they are time consuming to make and I'm not super happy with them right now. Stay tuned..

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

      that's why your videos are unique. we are actually seeing what's happening with the market data and the code over time and it is fantastic.

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

      @@neurotrader888 That would be awesome

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

      @@neurotrader888 I totally get your frustration, thats the reason I started making my own tool to visualize the data but it is not ready for release yet. Would like to make something more universal than I currently have, something like matplotlib but faster and truly interactive. BTW the style of you charts looks great!

    • @user-rv6mz5hs6o
      @user-rv6mz5hs6o 9 месяцев назад

      @@neurotrader888you should really post on that, my friends and I are always blown away with your visuals. If you could explain how you got to these or what books gave you inspiration for these we would greatly appreciate it. Thank you for your content, keep up the good work

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

    Could you also explain how to draw support and resistance lines and a profile during charting? Please advise.

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

    Please someone explain how this works to me... Is it that this works like an indicator you can apply on metatrader/tradingview or what?

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

    Can you explain the criteria for exiting these trades?

  • @Ejnota
    @Ejnota 3 месяца назад +1

    Hi would you to gives lessons inudemy or other platform I would like to be trained in this field

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

    This method will avoid highest highs and lowest lows. As well as levels at which the pricem bounce off but does not stay there. Why not searching for peaks on the price action it self? Maybe smoothed out? Why dressing the market profile based on time, maybe a volume could be more intresting? Or maybe both?

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

    What should be ideal hardware configuration for this type of computation?

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

      For this particular video any hardware is fine, its pretty light weight.
      For algorithmic trading in general I'd say having a lot of RAM helps for bigger tasks (many markets, low timeframe). My old computer only had 8gb and it routinely became a problem. It all depends on what you're doing.

  • @lucapalese475
    @lucapalese475 19 дней назад

    I dont get the interpretations of this levels as support/resistances, these are the most probable prices in the rolling window

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

    2:00 "Using raw prices will cause a bias toward lower prices in the density estimation on a larger set of input data. Logarithmic prices fix this issue."
    Could you elaborate, please? I don't see how this could possibly be true. A density measures the relative frequency of the underlying variable, one-to-one. In fact, taking logarithms and applying the inverse after some manipulation usually introduces a bias in the mean.
    Edit: the vastly unequal performance between short and long trades seems to confirm my doubt.

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

      Looking at very long price charts, it's now clear to me.
      Prices tend to move in percentages over equal periods rather than in absolutes.
      However, this occurrence of lower prices in long data is NOT a bias.
      Furthermore, the lookup used here does NOT reach far back enough to matter in the first place.
      Worse, the mean bias introduced by the log function is felt worse. Don't take log prices, they WILL distort your results!

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

    wouldn't this be a good case to use your `perceptually_important.py` instead of scify prominence?

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

      No, perceptually important points is meant for time series data. It would pick out peaks as well as troughs in the KDE. Prominence can also filter two peaks very close together while PIPs has no precaution for this.

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

    unreal

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

    Please comment the books name or resources for python which you went through to make this video.

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

      It's mostly combining different libraries to code out the math.

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

    fucking fire bro fire fire fire

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

    I see you're using matplotlib over pyqtgraph. Are there any specific reasons for this? I've managed to make pyqtgraph relatively fast by using buffered loading and I found matplotlib to be very unintuitive and slow but others have suggested matplotlib can be very fast at the core.

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

      Not really. I've used matplotlib for years so I'm used to it.

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

      Thats the cost of huge variety of features

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

      @@tradingtoolsdev Well, the penalty of features should mostly factor in when they're used. I know someone used it for realtime charts and to make it fast had a fairly hacky solution.

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

      @@incremental_failure Im not sure if I get the "unintuitivne" right, but to me the API is a bit strange and I think it is caused by some architectural decisions which were made to allow a wide range of features. So even when you dont use it, it still affects the final package. Would like to see if you find the fast mpl example. I did not managed to get it running fast, even panning in interactive mode always seemed laggy.

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

      @@tradingtoolsdev Yeah, I use MPL but only for stationary charts. Anything interactive is done in pyqtgraph, it's still a lot of work to get it how you want it but it's very doable and responsive.

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

    thaks for you work and contribution. I want to tak to you seems Im from argentina, developing a chanel, of python and finances in spanish. I might use some of your aprooches. and I want your agrement

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

      Sure. I would appreciate a link back to my channel though :)

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

      @@neurotrader888 Any way I can contact you ? Discord perhaps ?

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

    You make excelent content, but presentation is auwful. Speak like a robot without emotions and pauses.

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

      To be a good coder you need to be a robot without emotion. Might I suggest a different business for you. Perhaps customer service.

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

      @@neurotrader888 lol