Like the video? Support my content by signing up for Interactive Brokers using the link below: www.interactivebrokers.com/mkt/?src=ptlPY1&url=%2Fen%2Findex.php%3Ff%3D1338 Source Code: github.com/hackingthemarkets/ttm-squeeze Follow Me: Twitter: twitter.com/PartTimeLarry KZbin: kzbin.info Website: hackingthemarkets.com
@atrasnajwan3 жыл бұрын
this channel is true gem
@The_Matrix_I_Am3 жыл бұрын
This needs way more likes than you have.
@ScootLogix4 жыл бұрын
You got some really good content. I'm a fellow Quant trader. Keep up the good work, I enjoy following your vids. I'm gonna try to watch more of them on a weekly basis to keep learning. Best wishes.
@parttimelarry4 жыл бұрын
Thanks! Much more to come. Let me know if you have any requests or suggestions.
@siyuanouyang95844 жыл бұрын
@@parttimelarry I think we should perform a backtest on historical data and see the pnl chart for this indicator(or any other signal in general). To begin with we can do a simple daily position adjustment based on this indicator && a predetermined closing position rule(maybe a stop loss to start with~).
@parttimelarry4 жыл бұрын
@@siyuanouyang9584 I agree. This video was already nearly an hour long, so usually I chunk up the content into smaller pieces. There are videos on backtrader on the channel for anyone who wants to run the backtests. I'll plug in the signal code and try various sell conditions in backtrader when I get a chance.
@NoToBusinessCasual3 жыл бұрын
This was really helpful and gives a good insight into how we can use Strategies from Trading View to make our own versions in Python. As helpful as this is as groundwork, I feel that TTM Squeeze indicator alone can be really risky and without the Squeeze Momentum indicator, it serves half the purpose. Let us all try to make a Python version of the Squeeze Momentum Indicator as well. I think the only challenging part there is how to make an equivalent Linear Regression to arrive at the result. I hope someone will have a good answer.
@Roderickbernardino4509 Жыл бұрын
Dude , the exit is on the second dark green bar of the histogram. That’s according to John Carter, the inventor of TTM squeeze. If you wait till the end or bottom dark green bar, you will be giving back all your gains.
@mijhaelcastrociviero28482 жыл бұрын
Amazing tutorial I have changed the keltner mutiplier to 2 and I got the same that I get with Lazy Bear's Indicator! Just another one sucriptor. Cheers!
@JPy90 Жыл бұрын
brother broder broder! what can I say... you are the coolest in the family for sure! thanks man... I will no disappoint you
@LongTu167 Жыл бұрын
Really educational and helpful, very much appreciated Larry!!!
@nitin85164 жыл бұрын
I know this content will be gem so like button hit even before watching the complete video. Keep it up
@michaelnieder74273 жыл бұрын
This is so good. Great focus on solving the problem paired with awesome teaching skills.
@marctucker9317 Жыл бұрын
I appreciate your efforts to implement this indicator, and the clear concise way you explained it. I am trying to run this myself, I am thinking that some of the features or modules from 3 years ago have been deprecated because I am getting errors. Specifically at fig = go.Figure(data=[candlestick, upper_band, lower_band, mid_keltner, upper_keltner, lower_keltner])
@craigsaltiel38534 жыл бұрын
Larry, another great video. I am excited that you took my recommendation and implemented the strategy - I hope it works out in your real trading. Now, there were a fairly large number of stocks that came back as breakouts, but most of us are only interested in trading a few stocks at a time. One way to narrow the choice would be to do some back-testing and see if you could tease out the optimal settings or triggers (maybe with some machine learning?). Another possibility might be to look at the implied volatility of short term options - perhaps the greater the volatility the more explosive the move might be? I'm sure there are lots of other ways to narrow the choices. In any case, thanks so much for the video.
@parttimelarry4 жыл бұрын
Thanks Craig. Really appreciate the comments as they encouraged me to try better approaches. Will see if I can cook something up to run through some permutations of different settings / timeframes and present the results. Good ideas.
@parttimelarry4 жыл бұрын
Thanks Wayne, great feedback as usual. Ended up buying a few large caps, but am now curious to try this on the small/micro caps. I've realized I do too many videos using the S&P list, will load up a larger universe of stocks in a follow up.
@craigsaltiel38534 жыл бұрын
@@parttimelarry For whatever it's worth, there is a so-called 'improved' version of the TTM Squeeze (TTM Squeeze Pro) that has been out for a while (it is available for a hefty fee on ThinkorSwim platform). Today I discovered a pine interpretation on TradingView: www.tradingview.com/script/557GijRq-JS-Squeeze-Pro-2/. It includes 3 squeeze indicators. I would love to contribute by reconfiguring it myself into python, but it would probably take 10 years for this old Fortran IV programmer (who still remembers dropping stacks of computer punch cards for the old IBM mainframes).
@luthianotrarbach31452 жыл бұрын
Oh thanks million was looking for that for days. Actually, I had the idea about noticing this pattern. Bollinger bands already bring me profits, let me check that
@bruceroozdar91564 жыл бұрын
Well done Larry! Another excellent video bud 👍🏼
@parttimelarry4 жыл бұрын
Thanks!
@yax754 жыл бұрын
Awesome work dude, thanks for the great info. When I run the squeeze I also incorporate a rule that the close is above both the 8 and 21 EMA, also preferably a new high.
@parttimelarry4 жыл бұрын
Awesome, thanks for the additional rules. Excited to learn more about how others use this effectively.
@nj-bz8pv4 жыл бұрын
Quick becoming one of my favorite channels. Good job man
@parttimelarry4 жыл бұрын
Thanks, glad you enjoyed!
@behdad09792 жыл бұрын
love youuuuu maaaan , keep continue pleaseeee another good scanners like this
@lucrcoks5413 жыл бұрын
Great job Larry, really appreciate. I am little slow in catching up your videos. I assume this works on any timeframe but will do back test.
@jitkadyan4 жыл бұрын
Great Video again brother , pls make a video on Hekinashi Candle coding in python and indicator based on hekinashi candle data will be very useful for those who using this candle type for their strategy. thanks again providing us a super video
@wacskamati3 жыл бұрын
Love you Larry! Thank you for the amazing content!
@modelworkzseo4 жыл бұрын
If wolverine had a son with interests in computer science trading :D
@Newbie-dv9gc7 ай бұрын
nahhh.Sun wukongggg
@agatinofasanaro2814 жыл бұрын
Hi Larry i follow your channel from Italy and I really like your videos that connect trading and python programming. It would be very interesting doing something about multi_frame trading technique like Elder' s triple screen way to analyze and trade, or a market cycle detector using Elliott waves. Thank you very much for your super helpful videos!
@sushilkv20044 жыл бұрын
Amazing video! Thanks. Addition of histogram with gray and black dots would be great as thats important to know the direction to trade in. a secondary signal based on the histogram like long or short would be even greater for auto trading. And adding an exit criteria would be super great :)
@parttimelarry4 жыл бұрын
Agreed, will focus more on the histogram when I revisit this. Thanks!
@conandoct83303 жыл бұрын
This is some high-quality stuff. Gonna check out more of your channel, looks promising and underrated. Kudos :)
@vaporous74653 жыл бұрын
Amazing content dude!
@dineshkumarramasamy98494 жыл бұрын
Wow I just love the video! Thank you!
@GabrielsTears3 жыл бұрын
Thank you for the code. This is what I was looking for.
@maxdesko4 жыл бұрын
Top fan here 😊, keep it up plz 👍🏻
@cheebs39194 жыл бұрын
Thanks for the videos. I'd like to see a some videos on exiting positions. For instance, maybe after you take a trade on a squeeze - how to find the top.
@philippecharest95384 жыл бұрын
Great Video, thanks for sharing
@GQElvie2 жыл бұрын
really good, much appreciated. just one suggestion. for those of us who like to go by strictly code (no graphs), you did not advise how we can code whether it is a buy or sell (short). we had to go by the histogram below. dont we need the donchian middle point for this?
@walduss79393 жыл бұрын
Thanks for this video.. just starting with python and it has been very useful to understand new things. I will check if you have another video to implement an automatic bot to use this or other strategies
@maciekpaciarski93434 жыл бұрын
Great video. Source to learn a lot from it.Thanks
@dservais13 жыл бұрын
Dear Larry, very interesting vidéo as usual. Are you still using this indicator to trade ?
@nexttrader2714 жыл бұрын
you are doing really good job you are great really thank you so much
@iritesh4 жыл бұрын
Good content indeed! Subscribed. 🙂
@leonfung60814 жыл бұрын
As always, fantastic videos... can you create a video showing how to scan for renko reversals. I’m using TradingView but they won’t let u set alert if the renko brick size is ATR based... renko is the most precise way of enter and exit a trade.. thanks you ... and please let me know how can I support ur channel... god bless
@parttimelarry4 жыл бұрын
Hi, thanks for the comments! I'll do some reading on renko reversals and see what I come up with. Appreciate the specific requests. Also, I am exploring ways to monetize/support the channel as I go. So far I have added a few links here and there for various services, but many people already have accounts on these services. Will add more ways to support the channel over time.
@ballyoracle3 жыл бұрын
what a amazing video . Thank you
@paulollivier53664 жыл бұрын
This is great, have you figured it out how to calculate the momentum oscillator similar than TOS? I have found a few but they do behave differently.
@jaghadishrajagopalan15862 жыл бұрын
hi Larry - thank you so much for this (and other videos) - thoroughly enjoyed your videos - please could yu make one for "Darvas Box" theory as well if you find time? Thank you
@ceejay13534 жыл бұрын
Hopefully, I'm not too late for you to see, but I would love to see a Triangular arbitrage model even within an exchange in python. I've been looking around, and I can't find any good tutorials of somebody who has already done it. I think you would really like it!
@mkaberli4 жыл бұрын
At approximately 35.26 minute mark, you employed the absolute value to calculate the TR, but since the high will always be greater than the low, the difference between the two will always be positive, rendering the absolute value of the two superfluous. Am I missing something? Thanks for the video.
@The_Matrix_I_Am3 жыл бұрын
Do I need to manually delete all the CSV files if I change the stock list?
@fozzy93703 жыл бұрын
you should sell merch, first item = a printed hoodie reading "Easy Right?"-PTL
@mathewjohn30764 жыл бұрын
Thanks for the great content :).
@David-1243 жыл бұрын
Great video! If I wanted to incorporate more indicators, in separate panels (like you have on your TradingView screen with the histogram), is that straightforward to do in Plotly?
@chatishubhamjyotiprakash94733 жыл бұрын
Hi Larry, absolutely loved your content. Just one more thing any suggestions on when to exit a trade (Can we add some logic to generate SL and Targets along with squeezed stock signals)?
@gianpaolopassanante82943 жыл бұрын
Hi! Great video and good explanation about the process to calculate the squeeze, but I have a question, do you have a way to calculate the values of the histogram chart?
@Yasinzaii3 жыл бұрын
The KC channel mean is not the same as the BB mean as shown in TradingView. However, in your code you have used the same mean for both BB and KC. Why is that ? Do you think your implementation is better as compared to the lazy bear implementation.
@PavelSumik4 жыл бұрын
he is simply fantastique pythonist
@jeffcryptox82522 жыл бұрын
Hey Larry! Really nice and interesting script! Wondering if you have a version for crypto tickers? Thanks alot!
@hamad.learns3 жыл бұрын
Hi Larry! Why do you use the close instead of adjusted ? Thanks!
@WarzoneTales3 жыл бұрын
Bro, where to start to learn python and how much python do I need to implement my own indicators and or write my own scripts? How much practice did you need?
@pedroelias20973 жыл бұрын
First start studying python fundamentals, I recommend the ‘Python Crash Course’ book, but there are a lot of free courses here on yt (that’s up to u to choose). After learning the basics, start with the pandas and numpy libraries. U need to try! Set some projects and as you code it, if u get stuck, just go to google and type ur problem, probably u ll get an answer (if not try to approach the problem in some other way). U could try some other methods, these is the way that worked for me
@The_Matrix_I_Am3 жыл бұрын
what are pandas and plotly? re 10:18
@LowQuant4 жыл бұрын
Amazing Video, keep up the good work! Can you maybe add a video about how you set up the Visual Code Studio Editor? I'm on Windows and it looks quite different to your view, which makes it hard to follow along as a complete python/coding beginner. Also as a general idea - a short series of tutorials for beginners/ the right set-up or best practices when starting a new coding project can maybe also be of interest to others.
@parttimelarry4 жыл бұрын
Agreed, this is a good idea. I will add this to the list. My setup isn't that complex, but it would be good to talk about. I am also working on a Docker image to make it easier for people to develop against common dependencies.
@onlypencil2 жыл бұрын
How would you handle has 0 volume values in the volume column?
@anirbanphy Жыл бұрын
Is that possible to use this strategy for intraday trading with a live feed of Stock data?
@konst20873 жыл бұрын
Great tutorial!
@markzambelli10104 жыл бұрын
Very nice video!
@parttimelarry4 жыл бұрын
Thanks!
@dorobokedo4 жыл бұрын
Good Lord! What an excellent content you have here sir! This is definitely a 11/10 content rating! Thank you very much for sharing your knowledge with us. Can you please also translate the Higher High Lower Low, pine script strategy in tradingview (authored by: LonesomeTheBlue) to python language. Please please please! 🙏
@parttimelarry4 жыл бұрын
Thanks! I'll check out the script you mentioned and see if I can put something together.
@dorobokedo4 жыл бұрын
@@parttimelarryThank you! In my opinion this is a very good scalping strategy or in some occassions you can take advantage of big moves, because you can enter at the break of structure. Normally in a down trend, prices tend to make lower low lower high, but if it breaks it, and suddenly shifts momentum and creates a higher high higher low, more often than not, there is always a continuation of that new trend.
@MikeGemi3 жыл бұрын
Do you know how to histogram is calculated? Is it only momentum or is there more too it
@jaysond043 жыл бұрын
Thanks for making this, soo good
@Amit-et3ob4 жыл бұрын
In real time the condition can be reduced to: 4*STDDEV < 3*ATR. Great Video though!
@sushilkv20044 жыл бұрын
nice :)
@karthiksalian26924 жыл бұрын
How can we do this for intraday? Using Websocket for live data for multiple stocks?
@parttimelarry4 жыл бұрын
Yes you can use websockets or periodically make http requests on a schedule. Will do a version of this for shorter timeframes when I get a chance.
@karthiksalian26924 жыл бұрын
@@parttimelarry Ok thank you so much. I am able to do that for a single stock but unable to do it for multiple stocks.
@rverm10004 жыл бұрын
what that would is give you a tool to evaluate screeners for stock trading . find the most effective screening for the stocks condition you want to trade. that can be built into a stock trading program in python.
@crowellcrowell8944 жыл бұрын
Is it possible to use IBDs marketsmith with this algerithm
@parttimelarry4 жыл бұрын
Not sure, haven't tried Marketsmith to know much about it.
@crowellcrowell8944 жыл бұрын
@@parttimelarry cool thanks. If you try it you should deffinatly do vids on it.
@simonlee21824 жыл бұрын
Hi Larry, will you study and introduce the Heikin Ashi Strategy v2 by breizh29 indicator in TradingView? It seem a good indicator for some products in small time frame. Shall we translate this strategy to python for backtest?
@parttimelarry4 жыл бұрын
This sounds good, let me add it to me queue (which has grown quite large) and see what I can do. I still need to finish this full stack webapp series and have already agreed to do something with Machine Learning in December, so it may be a bit before I get to it. Cheers!
@rickypatel124 жыл бұрын
Hiii Larry.. I like ur work here.. i m following this in Indian market nd it is working pretty well for me.. now i would like to made a pattern scanner the same way u made for candle stick pattern scanner.. here I would like to scan price action patterns like Head & shoulders, flag, Channel, acceding triangles etc.. u see we can combine this squeeze nd pattern breakout near the or the breakout level.. the more time it will spend at the any breakout level the more strong and accurate breakout will be.. for example there is flag patter is formed now it is spending some time at the breakout level or resistance level means squeezing there for 2-4 candles.. u don't think so if that breakout happens it will be a strong pattern breakout with squeezing Can u let me know or made a video on it how to do it in python??? Thanks in advance bro..
@secretpanda00724 жыл бұрын
larry, is there a way we can auto chart the symbols that are printed 'coming out of squeeze' rather than the stock specified?
@parttimelarry4 жыл бұрын
Yes will figure out how to layout multiple charts on a single page with plotly.
@secretpanda00724 жыл бұрын
Part Time Larry i was thinking about having them each open their own tab, if possible. Right now I have it prompting me for a stock so I can choose from the ones listed
@nikoskarantzas10243 жыл бұрын
How about ascending and descending triangles? Those should be fun to code :)
@thabangtsajoa7164 жыл бұрын
Hi Larry, I am a technical trader, but I need to automate my trading... With python or some API's, can I be able to make a gap scanner for Pre-market on NYSE stocks, and be able to code INTRADAY patterns to back test them. can that be done with Python Jupyter or which IDE do you recommend ?
@luckyhithasri78604 жыл бұрын
Can you do it on CPR, virgin CPR, Previous Day High, Low ?
@siyuanouyang95844 жыл бұрын
we need to backtest this.
@iritesh4 жыл бұрын
min avg. win % is around 70
@mkaberli4 жыл бұрын
iRitesh : doesn’t the win/loss ratio depend on the sell strategy as much as it does on the buy strategy? You state that it’s around seventy, but where are you selling?
@iritesh4 жыл бұрын
@@mkaberli Loss is taken when the stop loss is hit.
@iritesh4 жыл бұрын
@@mkaberli most of the indicators are good enough if you know how to use them properly idk I am new to trading just what I have learnt since 2 months
@Ezeroth3 жыл бұрын
How to plot the actual Squeeze plot, Lazy bear uses linreg to evaluate and get corresponding color, do you know how to translate the linreg function in pandas?
@SniperUSMC4 жыл бұрын
Trading view SUCKS, it lags too much, pine script not my favorite either, there are a lot of things that can't be done that I want to do with it and you can copy and paste someone else's script into your own chart and it won't run. My experience with it has all been bad, which is what lead me to learn to code to make my own. BTW, you're a genius!! Thanks for the videos!
@TheL337trance3 жыл бұрын
Which video shows how to get the csv data from yahoo finance?
@Genesis092110 ай бұрын
Do you have a TTM Squeeze Pro for TOS
@yingkitchow51604 жыл бұрын
hey Larry thanks for another great tutorial! love it and please keep doing it Just one question: when im coding the stdddev and the bands, im running into this key error Do you have any idea what this might be? I just cant figure out why as im running on your exact source code. Traceback (most recent call last): File "/Users/Kit/Documents/TTM_squeezer/squeeze.py", line 16, in df['20_sma'] = df['Close'].rolling(window=20).mean() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/core/frame.py", line 2906, in __getitem__ indexer = self.columns.get_loc(key) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc raise KeyError(key) from err KeyError: 'Close'
@yingkitchow51604 жыл бұрын
oh i figured out why! but again thanks for the great content :)
@meesamz79193 жыл бұрын
does this work on forex and crypto?
@bril43914 жыл бұрын
Mate, could you please do market/volume profile with python? thanks
@mikest85304 жыл бұрын
Hi, i have a question i clone the repo from github but i dont know what to do next. How do i run it ni visual studio? thanks
@satishchaudhary78754 жыл бұрын
Please make video on backtest using python
@iritesh4 жыл бұрын
Better use: if df.iloc[-5:]['squeeze_on'].all() and df.iloc[-1]['squeeze_on']: print('%s: In Squeeze' % coin) to confirm the squeeze lasted for sometime (for short interval)
@angelpina49462 жыл бұрын
Greetings, please code to python this line does not appear in the video Thanks good job greetings val = linreg (close - avg(avg(highest(high, 20),lowest(low, 20)),sma(close, 20)), 20, 0)
@davewakefield15934 жыл бұрын
Great videos - really well explained. Can you consider creating a similar scanner based on Binance crypto data and relative EMAs. e.g. get list of all xxxUSDT pairs. For each, get last 200 one minute candles and calculate e.g. the 7, 25 & 200EMA, then identify any coin where say the 7 EMA has just risen above the 25 and the 200. Could list out such coins or generate price candle/EMA line graph for qualifying coins. Would also be good to see how all that could be put into a run/display output loop with say a 2 - 5 min delay to effectively constantly monitor the binance coin prices and repeatedly display the EMA switch over opportunities. Thanks
@NetZeroExpert4 жыл бұрын
The think or swim platform was created, built and sold to TD Ameritrade by the guys at Tastytrade.com
@omeryazici53183 жыл бұрын
perfect video
@rverm10004 жыл бұрын
can you do a video on scanners effectiveness. ? this might be a tough one. i made a scanner in tdameritrade. it is awesomeOsc crosses above 0 within 10 bars, close is greater than sma15 within 5 bars, price change (close) is at least 2% greaater than 5 bars ago. what i would like to do is capture the watch list once every 5 minutes. then take that data and create a bar chart that would show the the time of day the stock condition was true. then look at stock chart and see if the condition that the watchlist captured was true how much it would have made. that way i can begin to see if the scanner is effective. can you do a video with tdameritrade being used to check the stock scanner effectiveness?
@parttimelarry4 жыл бұрын
I did some videos on backtesting with backtrader. This screener could be tested using this library. Got quite a few requests in the queue, but will get to it when I can.
@colinmaharaj3 жыл бұрын
I need to convert that to C++ soon
@lifeatmemes Жыл бұрын
anyone know how to convert daily data to weekly and monthlies?
@The_Matrix_I_Am3 жыл бұрын
Not sure if it is okay to ask for help here or not. I got most of this to work okay. I changed the stock file. at first I think it was too big, so I made it into only 12 stocks. I still have issues running squeeze.py Here's my output. I really don't know much about python, so any help would be greatly appreciated. File "c:\Users\Rich\Desktop\Investments\ttm-squeeze-master\ttm-squeeze-master\squeeze.py", line 30, in if df.iloc[-3]['squeeze_on'] and not df.iloc[-1]['squeeze_on']: File "C:\Users\Rich\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pandas\core\indexing.py", line 895, in __getitem__ return self._getitem_axis(maybe_callable, axis=axis) File "C:\Users\Rich\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pandas\core\indexing.py", line 1501, in _getitem_axis self._validate_integer(key, axis) File "C:\Users\Rich\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pandas\core\indexing.py", line 1444, in _validate_integer raise IndexError("single positional indexer is out-of-bounds") IndexError: single positional indexer is out-of-bounds
@luckyhithasri78604 жыл бұрын
Brother again +/- operators in the source code needs to be updated correctly in the github.
@NoToBusinessCasual3 жыл бұрын
Not that it matters to the main topic, but unfortunately PLOTLY is a horrible package. Time and again I have encountered that once or twice the plot comes up (rendered in the browser), but then it starts taking forever... literally FOREVER. i.e. it never comes.