How I Achieved a 74% Profit Using Michael Harris’s Trading Pattern in Python | Full Backtest
HTML-код
- Опубликовано: 15 дек 2024
- In this video, I walk you through how I achieved a 74% profit using one of Michael Harris’s trading patterns. I’ll show you exactly how I coded the backtest in Python, step-by-step, and applied algorithmic trading logic to both the QQQ (Nasdaq-100) and S&P 500 historical data. You’ll see how I implemented the pattern recognition, set stop-loss and take-profit targets, and verified the results through a full algorithmic backtest. By the end, you’ll have the knowledge and code to replicate this strategy for your own trading experiments.
📘 Book available on Amazon (Algorithmic Trading Hands-On Approach Using Python):
a.co/d/6woMBHt
Discount Vouchers for my Algorithmic Trading and Python courses:
💲 Algorithmic Trading: bit.ly/CouponA...
💲 Data Analysis with Numpy and Pandas: bit.ly/CouponD...
💲 Machine Learning Methods In Algorithmic Trading: bit.ly/CouponM...
💲 Python Beginner Course With Solved Exercises: bit.ly/CouponP...
💲 Object Oriented Programming in Python: bit.ly/CouponOOP
Grab the Python code here, and the data files as well:
drive.google.c...
Good luck Guys! Enjoy coding in Python :)
I love that you test all these ideas out so thoroughly. It always gives me more to add to my own strategies (or not add). Thank you.
Thank you, makes total sense, the purpose here is not to present full strategies, but to test simple ideas/indicators/patterns that can be plugged or added into strategies with other indicators and filters.
Nice video, thank you! I was just wondering why using fixed percentage instead of using the ATR like in different videos.
Glad it was helpful! fixed percentage versus ATR no particular reason, actually all of these trade management methods are not the purpose of most of the videos testing indicators and patterns, these (indicators and patterns) are usually used for entry meaning to enter a position and open a trade, however the rest is how to manage the trade once it's opened and for that there are lots of approaches...
Technical analysis Always work over a time frame with the underlying trending in one direction. Even a long short strategy stops working when the market starts trending downwards as the movements tend to be much faster on the way down and TA signals lag.
I agree the uptrend pace is different than the downtrend especially for stocks, crashes happen fast, so it's better to split strategies into long only and short only strategies with different approaches.
Great work again. Thank you
Thank you for your support!
Amazing..learnt new things!! Thanku
Glad to hear that, thank you!
New subscriber - Thank you!
Awesome, thank you!
Excellent, a question where can I learn how to connect py code with Tradingview? Thank you very much
U can't. Only data can exit trading view with webhooks in json format
Not sure this is possible unless thay are selling an API which might not be a free option (if it exists)
I haven’t done Python in many years. Great job on this work! Personally, I do the same in C# on NT8, focusing on futures markets (ES, NQ, YM), which have been heavily traded by retail traders in recent years thanks to access through prop firms. I haven’t watched all the videos yet. What is your favorite strategy among those you’ve backtested?
Thanks for sharing! A full favorite strategy I don't have one, it depends on how the market looks (trending or sideways), but I do have favorite indicators (support and resistance levels along with candles patterns on the daily timeframe).
Among all these strategies which one is your favourite
daily timeframe, support resistance with rejection candles happening around key levels, this the entry study but then comes the trade management or exit decision and that's much harder.
@@CodeTradingCafe by any chance did you code the support & resistance with rejection candles?
Not together here on YT but you can check these videos for some help: ruclips.net/video/MkecdbFPmFY/видео.html
ruclips.net/video/xky3ZiCsEDs/видео.html
ruclips.net/video/aJ8Og-iLaas/видео.html
thanks very much as always.this one looks interesting. Is there any way I can reach you to see if you would be willing to backtest a really interesting forex strat that has been performing very well recently please?
Dear CodeTrading, where do you place your limit or entry during backtesting...Is it the same as the current_close
Hi, yes once the pattern is confirmed the signal is at the end/close of the current/last candle.
would it be logical to optimize and find the best TP and SL parameters for short positions and do the same for long position, this way you dont use the same parameters for long and short posibly yielding better results? would this overfit the data?
Actually I like your idea, especially for stocks they usually have different speed in climbing and dropping, so having 2 different sets of exit values makes total sense. Regrading overfitting... we are always overfitting somehow can't really totally get rid of it.
Hi, how far are the strategies you present us in all your videos from being profitable in the "real world". I mean, if we create a bot to trade based on this strategy, for example, would it be profitable? If not what would be the next steps to take bebidos the o és you mentioned?
Hi, I usually present and test single indicators or double indicators strategies, and I often neglect the trade management part. For a profitable real world strategy you need additional indicators for confirmation (they must be tested) and a looooot of work on the trade management (and risk management) part which in my opinion is the hardest. It's relatively easy to find a winning set of indicators but the trade and risk management are where the difference is made.
@@CodeTradingCafe Thank you for answering! Do you have something on your list about going deeper on trade management? I think it would be interesting to share that knowledge with all of us. Keep your excellent work!
It's harder to put this into a video, I would say the best is to exit/manage the trade manually because this relies a lot on experience of the trader, experience is mainly reading patterns that are red flags the trades should be closed because the market might be reverting, for example opposite candle patterns, reaching a key level ... the issue is that there are lots of scenarios that are harder to cover in videos although I do include some from time to time in the backtests.
okay now show the real money you got, account balance
It's slow 10 to 20 % yearly ... no get rich quick scheme sorry to disappoint.
Very interesting thanx 🤩 Do you think it is possible for you to create a series of videos or even a masterclass to detail the process of generating robots through machine learning with Python, but the way the EA Studio or StrategyQuant apps do it? It is a matter of automatically creating robots from tests of combinations of indicators and money management rules, then filtering by certain criteria (number of trades, performance, minimum profit factor, minimum R-squared for equity, etc.), then setting up an automatic forward testing with filtering of the best robots, then a Monte Carlo testing with filtering of the best robots according to our criteria. All this data processing chain would be like a great funnel to automatically filter and select the best seeds. It would be great please 🙏
Hi, thank you for your support. Actually your idea is great, but it's a lot of work/time. I am not sure this is good for YT video :) maybe I will break it into fragments in the future.
@@CodeTradingCafe Oh thank you very much! Yes in small pieces, I'm sure other people would be interested
Which time frame?
daily my favorite
Hi, I have a strategy but i don't know how to implement it. I have tested it but manually, it's in hour frame and it gives good result in daily frames. Also it gives good number of trades in a month (around 20). Can you give me a hand?
If you really really tested it, then we can backtest it in python, send me the details by email codingntrading at gmail com
Do you use tickdata?
No need, just daily because the pattern is checked only when the last candle is closed.
I think there is data leakage here, but I could be mistaken. We don’t know what the current candle high will be before it closes, hence you have to shift the time series by 1. I am not sure if this will mean you can keep the current win rate and profitability :(
Hi, there is no leakage as long as we run the test at the end of every candle meaning after the candle has closed, these are daily candles so at the end of every day we can test for the pattern occurrence.
Can I integrate MT5 ?
Needs to be translated to mql5
I test this with bitcoin 1h data from 2018 to nov 2024.
The result is very bad. :(
Hi, these patterns only work on daily timeframe, any lower timeframe will NOT work for sure.
Thats is a perfect chaos strategy ahah
Well maybe, but someone (M Harris) made some buck out of it.
@@CodeTradingCafeyes he made a buck by selling a book
Traders do make make some money ... but much less than what people think, this is why they start selling books, also they get some exposure.
Oh Gosh! These Stuffs are just too complicated for me.Could not make anything from what I have just watched.Is Trading this complicated?😮
Hi, no trading is not, it's the coding part. You can just check the videos for the input, the strategy and the results, skip the coding, if the results are good you can keep the idea for your manual trading.
Anyone used this in their automated trading?
From his book he probably used these for entry signals but the trade management (exit and risk management) are not be forgotten and these were not detailed in the book...
Probably much easier to do this in MQL5 without all the dataframe and backtesting stuff. I mean you pretty much have to be a Python expert to use this code , but if you were a Python expert you probably won't be watching these videos.
... or learning to be a python expert