Technical Analysis Library in Python Tutorial

Поделиться
HTML-код
  • Опубликовано: 22 сен 2024
  • Like the video? Support my content by checking out Interactive Brokers using the link below:
    www.interactiv...
    Buy Me a Drink: www.buymeacoff...
    Also, I will be starting a spinoff channel on AI in music, art, and gaming in 2023. Subscribe at: / @parttimeai
    In this video, we demonstrate the Python TA package. Yet another technical analysis library for Python.

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

  • @parttimelarry
    @parttimelarry  3 года назад +10

    Like the video? Support my content by checking out Interactive Brokers using the link below:
    www.interactivebrokers.com/mkt/?src=ptlPY1&url=%2Fen%2Findex.php%3Ff%3D1338
    If you like this video and want to support the channel:
    Buy Me a Drink: www.buymeacoffee.com/parttimelarry
    Note: In this demo, it turns out I was running an early/old version of ta, which has the strange behavior of computing the moving average for the Bollinger Bands even for the first bar. So for the first bar, the average was equal to the closing price of the first bar. For the second bar, the average was the (first + second bar close) / 2, and so on. After upgrading to version 0.7 the numbers are now what you would expect - NaN values until there are 20 bars to average. Thanks to Todd below for pointing this out.

  • @sriramkrishna6853
    @sriramkrishna6853 3 года назад +33

    Larry is the best teacher ever. Such amazing videos and value as always.

  • @LongTu167
    @LongTu167 10 месяцев назад +1

    This is amazing video. Thank you very much Larry!

  • @alibulus4382
    @alibulus4382 2 года назад +1

    You are amazing dude.

  • @scottv6506
    @scottv6506 3 года назад +8

    Larry you are a fantastic and very clear teacher. I appreciate what I am picking up from your channel

  • @k2icc
    @k2icc 3 года назад +6

    You make this look very easy, but I know you do know the stuff. Thanks a lot for taking the time to share it. That speeds up anyone learning experience by a lot.

  • @glopessantos1
    @glopessantos1 3 года назад +1

    thanks a lot for your contribution

  • @investvest4571
    @investvest4571 3 года назад +1

    Awesome tutorial! Easy to follow. Thank you.

  • @lokendrayadav91
    @lokendrayadav91 3 года назад +3

    Hey man trust me you are awesome 😎

  • @cetilly
    @cetilly 3 года назад +5

    Awesome topic and very well presented. I also prefer TA; good call

  • @lorenzoquadrelli7237
    @lorenzoquadrelli7237 3 года назад +1

    Exactly what I was looking for! Glad you decided to cover this library just now. Yesterday I was working on a bot hardcoding all the formula and math 😆 and than I found your video. It's gonna save me a lot of headaches 🤞🏽 cheers!

  • @nishadseeraj7034
    @nishadseeraj7034 3 года назад +1

    Just wanted to say Larry that I really appreciate your videos! I come from a stats and finance background so while I understand the finance concepts in theory and on paper with all of the nitty gritty maths , translating to code has never been easy for me. I have some experience but your videos are super and has made the transition so much smoother! Thanks mate and I'm looking forward for more stuff!

  • @InsertGreatChannelName
    @InsertGreatChannelName 3 года назад +3

    Nice, my man back again with Ta

  • @typeer
    @typeer 3 года назад +1

    back again! great as always thanks larry

  • @thedude3369
    @thedude3369 3 года назад +1

    Thank you for making these your videos are excellent and very informative.

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

    Be GREAT to see a video on Python Trading Bot using TA lib that alerts on price crossing MA, and MA's crossing.

  • @BenjaminBalaj-yp8zk
    @BenjaminBalaj-yp8zk Год назад +1

    A sub to you my good sir!

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

    Was there a part 2 for this? This is GREAT! Thanks!

  • @tak68tak
    @tak68tak 3 года назад +1

    Awesome as usual. twelvedata is awesome btw. You can get a Pandas dataframe simply by
    from twelvedata import TDClient
    td = TDClient(apikey=twelve_key)
    ts = td.time_series('symbol'= 'AAPL')
    ts.as_pandas()

  • @somajuice666
    @somajuice666 2 года назад

    YES LARRY! NICE TO SEEYOU AGAIN :D

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

    Gr8 info vid.
    Please make a vid on roadmap to learning python specifically for stock chart analysis , getting trade signals using chart and statistical analysis of stocks.
    I mean make a vid on course tailored cut for only stocks analysis.
    Regards
    Farid

  • @taraspanamarev6281
    @taraspanamarev6281 3 года назад

    Great content! Can't wait for the next video! Would be very interesting if you back-test your upcoming supertrend strategy with backtrader

  • @javidhb
    @javidhb 2 года назад

    it was extremely useful.... tnx

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

    Great video, very clear.
    Please make a video on roadmap to learning python from scratch, specifically for stock analysis, chart analysis, getting trade signals using charts and statistical analysis of stocks. I mean create a roadmap on the course tailored cut for only stock analysis .
    Regards
    Farid

  • @maxxgray2539
    @maxxgray2539 3 года назад +1

    Looking forward on your next videos, are you going to use backtrader to test your strategies?

  • @connorpatricks4922
    @connorpatricks4922 3 года назад +3

    Hey Larry thanks a million for you videos man! Your lectures are so easy to follow and you explain even the most complex concepts to clearly yu make itso easy. Yu are a genius man. Im trying to transfer your supertrend code into freqtrade but its not working for me. I like freqtrade coz yu can give bot a select number of assets to trade on instead of running many bot instances. Or maybe is it possible to add more assets for bot to monitor in this supertrend strategy. Your ecample has eth/usdt just wondering if adding more would work. Thanks dude

  • @in_the_6ix
    @in_the_6ix 3 года назад +12

    Hi Larry - awesome video - thanks so much!
    Curious behavior in the BollingerBands on my Windows PC (Python 3.8.4)...
    When I run "bars = exchange.fetch_ohlcv('ETH/USDT', limit=20)", I get NaN values for upper_band, lower_band, moving_average (except for the last row). If I remove the limit and use print(df[-20:]), the values are fine.
    Is anyone else seeing this output?

    • @FranklinMinty
      @FranklinMinty 3 года назад +3

      Yes...Larry is a Wizard and can pull data from the past to calculate MA on the first bar. We're mere muggles...

    • @IrfanA7861
      @IrfanA7861 3 года назад +1

      Yes I am having the same issue

    • @IrfanA7861
      @IrfanA7861 3 года назад

      @@FranklinMinty Yes seriously how he got the 20 bars average?

    • @parttimelarry
      @parttimelarry  3 года назад +3

      Hey let me check on what the deal is here, you are right the result was strange but I didn't catch it while I was recording.

    • @parttimelarry
      @parttimelarry  3 года назад +16

      Great catch. It looks like the version I had on this machine is very early/old. I had ta version 0.5.11. The values you got are the behavior I would expect. On the old version, instead of filling the first X values with NaN, it averaged what it had so far. So the first value of the moving average was equal to the first close. The second value of the moving average was the (first close + second close) / 2 and so forth. I upgraded the package -- ran a pip3 install --upgrade ta and now I have ta version 0.7. I re-ran with newer data and the behavior is now what you have and what I would expect. I will make a note of this in the next video and in a pinned comment. Thanks for pointing this out.

  • @vamsikrishna8132
    @vamsikrishna8132 3 года назад +1

    when is the next video coming? eager to learn

  • @fivetenash
    @fivetenash 3 года назад +1

    yeeee

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

    You made 3 intresting stocks scanner videos in the past using TA-Lib, I could't install that library and I want to do a stocks scanner using the TA library in this video and I don't know how to start. Are you planning to remake the stocks scanner videos using TA?

  • @adeisidaemon
    @adeisidaemon 3 года назад

    This library is a joy to use compared to ta-lib, it has a vortex indicator for a start, you don't have to dick about with dependencies on 64bit Windows, it is certainly more Pythonic like you say and it isn't as buggy. Cheers Larry.

  • @muratisler9954
    @muratisler9954 3 года назад +1

    Thank you for the nice videos, I just wanted to say that, TA doesn't have MA types selection like TA-lib, different MA types are very important for trend trackers. Supertrend looks nice but not efficient and hard to optimize because it jumps on the bands :) For the first look, the super trend seems great but when you backtest it, the results are not good enough.

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

      Supertrend is useful for visualizing trend reversals in terms of ATR magnitude, but it most definitely does not cut it as a standalone indicator. It’s not a bad filter though.

  • @unyimeakn9615
    @unyimeakn9615 3 года назад

    if you are having issues installation ccxt on windows. Open cmd has admin.

  • @jackroark6928
    @jackroark6928 2 года назад

    ⭐❤

  • @IBetraye
    @IBetraye 3 года назад

    Hey Larry, first of all, great videos! You've helped me big time. How would you loop through a df where multiple coin pares are available, making it so that the ta trend functions are reapplied and recalculated on every pair in the df? Thanks!

  • @MarcusVinicius-lq3fe
    @MarcusVinicius-lq3fe 2 года назад

    Hi Larry I have watched all videos from API Binance Tutorial very nice! I have a question: which method returns me the market current/real time PERCENTAGE variation (from Ethereum for example) ? I got that just doing web scraping using selenium but I would like to get this info using the API.

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

    I have local database table with Symbol, Date, Open, High, Low, Close, Volume columns. getOHLCfromDB(symbol, startdate, enddate) is the fuction which will extract OHLC data. I would like handler to work on extracted dataframe df. Is there possibilities to analysis for my local data.

  • @F12545
    @F12545 3 года назад

    Hello from Cuba. Try to use Order Flow

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

    If only TradingView would come out with a Python version that replaces Pine Script.

  • @tyler.farmer
    @tyler.farmer 3 года назад

    question on the Close Price: when you look at a bar with the OHLCV, is the Close value for that minute, or the previous minute? The reason I ask: The ATR calculations use the Max [ (High-Low), (Abs(High - Previous Close)), and (Abs(Low - Previous Close)). So wondering if we should use the Close value on the same row, or use the Close value from the Previous Row?

  • @abdullahb4367
    @abdullahb4367 3 года назад

    awesome video as always. is there a way to trade based on Renko charts in this python?

  • @jack_sparrow1049
    @jack_sparrow1049 3 года назад +1

    I have a question :-
    i have written a strategy in Pine_script ( tradingview) but i want to convert it to python. Please can you tell which libraries can help me to do that because my strategy is very complex ?
    there are few limitation in pine script so i want to shift to python............Hope i get reply from you😎

    • @jadhavpratik37
      @jadhavpratik37 3 года назад

      Same problem with me. Since Pinescript is the language of TV, it might be a bit difficult to find a way around it

    • @jack_sparrow1049
      @jack_sparrow1049 3 года назад

      @@jadhavpratik37 if u can understand the math of indicator or your custom formula/ indicator it is very easy to convert it to python using pandas if u don't have any custom indicator or formula then you can use " ta lib" library to make your algorithms as almost every indicator is available in that library 😀
      Pine script is the best language for creating strategies if you stay with the pine script you will easily understand that

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

    can we use for stock ?which library can i use

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

    Hi
    Can get the code for WEEKLY supertrend? thanks

  • @jamiekenber
    @jamiekenber 3 года назад

    It's a pain to install TA-Lib but that's because it runs on faster native languages. Wouldn't want to be relying on Pandas to process thousands of stocks with any kind of frequency

  • @maheshguntty
    @maheshguntty 3 года назад

    Hello bor can u give example of SMA cross over using Pandas_ta plz

  • @Mr.Jah99
    @Mr.Jah99 3 года назад

    I have been using python38 and print (upper_band) it shows the powder as below.
    What did I do, where did I go wrong? Help me.
    import ccxt
    import ta
    import pandas as pd
    import config
    import schedule
    from ta.volatility import BollingerBands, AverageTrueRange
    exchange = ccxt.binance({
    'apiKey':config.BINANCE_API_KEY,
    'secret':config.BINANCE_SECRET_KEY
    })
    bars = exchange.fetch_ohlcv('ETH/USDT', limit=20)
    df = pd.DataFrame(bars, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
    bb_indicator = BollingerBands(df['close'])
    upper_band = bb_indicator.bollinger_hband()
    print(upper_band)
    .......................................................................
    0 NaN
    1 NaN
    2 NaN
    3 NaN
    4 NaN
    5 NaN
    6 NaN
    7 NaN
    8 NaN
    9 NaN
    10 NaN
    11 NaN
    12 NaN
    13 NaN
    14 NaN
    15 NaN
    16 NaN
    17 NaN
    18 NaN
    19 2433.810588
    Name: hband, dtype: float64
    >>>

  • @Ligariuz
    @Ligariuz 3 года назад

    What lib did You recommend to plot this?, like trading view?

  • @kaypbalk6027
    @kaypbalk6027 2 года назад +1

    I still got Nan error. How can I fix it?

    • @giratinum
      @giratinum 2 года назад

      increase the number of candles. BBand needs 20 candles to caculate but you give only 20 candles to it.

    • @kaypbalk6027
      @kaypbalk6027 2 года назад

      @@giratinum thank you :')

  • @ai.simplified..
    @ai.simplified.. 3 года назад

    Is it possible to automate everything for online trading like a bot?

  • @unyimeakn9615
    @unyimeakn9615 3 года назад

    Can you do tutorial using redis thank you

  • @xuan_learning
    @xuan_learning 3 года назад

    I have one question that I hope someone can help me with. I think I have the identical code, but my upper_band= bb_indicator.bollinger_hband(); only return index 19 and the rest of the indexes are showing NaN. WHY?

    • @giratinum
      @giratinum 2 года назад +1

      increase the number of candles. BBand needs 20 candles to caculate but you give only 20 candles to it.

  • @ShujaathKhan
    @ShujaathKhan 3 года назад

    How diff is this compared to finta or talib?

  • @DGDaytrading
    @DGDaytrading 3 года назад

    Which Program is that on 3:20 you are using?

  • @colinmaharaj
    @colinmaharaj 3 года назад

    Love your content. But I prefer C++

    • @parttimelarry
      @parttimelarry  3 года назад +1

      Awesome. I would like to do a few tutorials on other languages. I am not as proficient with C++ since I only used it at school and not professionally though. Python is a good language for teaching I find.

    • @colinmaharaj
      @colinmaharaj 3 года назад

      @@parttimelarry Here's the weird part, because I havee so much C++ on the brain, I seem to be less inclined to do python. I have 25+ years experience in C++ and can write any kind of code you can think of.

    • @colinmaharaj
      @colinmaharaj 3 года назад +1

      My goal is to do analysis for about 30 stocks and once and find the best entry point for each thread/ session.

  • @afblaze94
    @afblaze94 3 года назад

    What ide are you using in this video?

    • @parttimelarry
      @parttimelarry  3 года назад +8

      Visual Studio Code with Python extension. I really need to make a tutorial on just this topic since the question comes up a lot and I realized I naturally use certain shortcuts to browse the libraries I install, but not everyone has this configured.

    • @afblaze94
      @afblaze94 3 года назад

      @@parttimelarry That will be a great help!

    • @taiwo_the_illusive
      @taiwo_the_illusive 2 года назад

      @@parttimelarry this would be really helpful! Would be great to know some of the plug-ins you use

  • @VikasPatel-cu4ci
    @VikasPatel-cu4ci 3 года назад

    Can renko chart with wick help bro