I would also suggest to show the performance on a down trending stock - in other words but what happens with this strategy if your stock becomes unliked by the market? Overall, very good video. Thank you
On lower timeframes that would cancel most of the returns, on 4H and daily it's good, actually the commission I added 0.002 is relatively large and covers for spread and slippage)
I have seen a strategy with the BB on the 4 hr timeframe. When price breaks upper BB, strategy would go short until MA is reached. Or long when breaks bottom BB.
Hi just wanted to say I love the work you did on Rayner teos strategy amongst all the work you put in. Is it ok to ask whether you could backtest a simple strategy with a set of simple rules? It’s a price action strategy. I’ve been confused. (I’m a swing trader who’s doing well in demo/forward testing but I’m struggling with becoming profitable for various reasons one is over holding positions etc, and I’ve heard all types of ways to backtest but just not getting it. apologies for being long winded and I hope my ask isn’t too much. Thanks in advance.
Hi, thank you for your support, send me the conditions of the strategy, I will make a video if it's interesting. If you prefer to send an email it's codingntrading at gmail com
I wasn't trying much with crypto but you are right, actually the advantage with crypto is that the volume data is centralized so we can use the volume information also for trading... more videos :)
Hi testing please this strategy next time from (serious backtester, Consistently Profitable Trading Strategy! 200,000+ Trade Backtest! Best Results Yet!)
It rings a bell, I probably have the code somewhere because I remember the video. I will check it out and make something if the results are interesting to show.
So if I have a Binance trading bot that fetches data from the Binance API, then calculate the bollinger_bands with that data, I will have different amounts than TradingView for example? Meaning -> working with Binance API data will make my plot different than the one in TradingView after adding a BBand per say?
The data might be slightly different but actually it's the BB computation that might be very different depending on which formula the platform is using, but if you are getting just price data from the platforms (Binance and TV) and you compute the BB in python let's say using the same approach then there is no reason to see large differences.
I saw an interesting video a few weeks ago from Nick Shawn - how i make money trading, even when i’m wrong. Might be good to try and automate this in python and see how it works out in a live trading scenario. An algo shoud easily be able to work out the optimum position size
I find your results to match the potential flaw in your implied thesis on this test. You assume this will detect opportunities in already bullish markets. But the screen shot is trading sideways, like a commenter already pointed out. This in turn means the band should be relatively stable as volatility is relatively uniform. Now a rally starts the band shoots up, now you only look for confirmation for this bullish inclination and there you go. At the same time if you want a warning signal against a market shift this looks like it would warn you of a turn in the market's behavior which would typically end in a price correction that causes draw down in a long only strategy. I think this is more of change of pace detector then anything. This in turn means looking for bullish signs in a bull market will not yield an edge on outright holding. Imagine you have a strategy that uses IV changes to deduce good entry points, well a short squeeze like GME will screw you royally because you are not looking for it but you dont filter it out. I hope this helps to illustrate my point
Thank you for your detailed comment. I agree that the current test conditions in a sideways market might not highlight the full potential of the strategy, it's true that the indicators are showing more the start of a potential rally. Your example of IV changes and the impact of events like short squeezes is also very relevant. This means that we keep the indicator but we will use it for completely different purposes now... looks simple but it gets complicated very quickly :)
For a strategy to be 'successful' it needs to a) outperform buy and hold b) have a lower max drawdown than buy and hold. Many so called 'strategies' are profitable but they are not good enough to out perform 'buy and do nothing'. You can buy the close and sell the open on SPY and be profitable... but massively underperform B & H
Hi, I agree, in principle yes, but no realistic strategy will beat a buy and hold on strong and always long stocks, like Amazon, apple, MS, SP500... historically on a monthly/daily timeframe these were always trending up with some retracements, it's very exceptional if a a strategy can beat B&H on these stocks. But in principle yes I agree with you on the 2 rules especially drawdown often disregarded in backtesting. That being said, the strategy in this video is a very bad one 😂
When you pass a buy or sell you can use the limit parameter and provide where at which price the limit is placed: self.buy(sl=sl1, tp=tp1, size=self.mysize, limit=limitvalue)
if I add current candle high as limit and next candle go above that price what is the entry price? entry price = limit price or second candle's open price?
It doesn't look like this strategy is good for trending stocks, on the screenshot it doesn't look trending up, it looks like it was sideways for quite a long time before breaking up. In general trending stocks would have a hard time breaking the channel, because the channel will be very large. I would rather expect breaking channel from stocks that don't change a lot, so the channel is small, but for some reason they get attention and price rockets up high.
I agree, I noticed it highly depends on the channel width, but since the original video used 4X standard deviation I had to try it, but it's way too wide for a break out to happen. So yes no signals most of the times and for a lot of stocks.
I could, if you are running the code actually it's very simple to modify the margin ratio so the leverage, otherwise I will keep it in mind for future videos, But I personally don't like high leverage it's not sustainable.
Why don’t you ever look at research papers instead of UA-camrs for results, as often research papers often have proper back tested results compared to UA-cam just being mainly a entertainment platform
I hope my answer will not sound harsh, I have published numerical/modelling papers (over 65 academic papers, mostly in physics) and I am really familiar with the scientific/academic world. In this field (trading and backtesting) I found more interesting approaches than academic papers here on YoouTube (I repeat... in the field of trading only), more pragmatic and straight to the point. That being said, I still read financial research papers (average 2/week) to follow what's happening, now everyone is tweaking Machine Learning but nothing interesting so far. What I found interesting are books (some are useless though, but other can bring some inspiring ideas).
I've tested a lot of strategies from papers and most are garbage tbh. Luckily de prado brought more light to the problems within the academic realm of financial research.
Hi Ziad. I do not think it is a good strategy. For a strategy to be considered as viable it should perform at least 2x better than the buy and hold approach.
Hi, it's hard to beat the buy and hold for stocks who had a long term uptrend (daily timeframe) because a buy position keeps earning profit. But I agree with you that the strategy is really bad, at first the indicator showed 0 signals I had to tweak it to get a signal out, so it's all unclear.
@@CodeTradingCafe yes I see your point. We should think about something like a trailing stop in order to stay in the trade longer. The ATR is good approach and we could use it as our trailing stop. I do not know how I could program it in python though (yet hehe). The idea for a long trade is that once the ATR is set to not go lower, only higher as price moves higher and remain 2 ATRs below the highest price. So practically trading without take profit. Only a moving stop loss.
I can see that you didn't watch the full video :) hmm check the code the trailing stop is there, I used both a percentage trail and an ATR trail in the code (download file I mean, the video only shows percentage trail stop).
You might be surprised to see a very simple (super stupid) strategy working well on a real account. I tried very complex strategies including Machine learning, neural networks ... simple works best (not the strategy in this video though), and it's much easier on higher timeframes.
I would also suggest to show the performance on a down trending stock - in other words but what happens with this strategy if your stock becomes unliked by the market?
Overall, very good video. Thank you
Thank you for your support, yes I assume we can apply symmetrical conditions for short positions as well, not sure about the results though.
What do you think of adding bid-ask spread and slippage?
On lower timeframes that would cancel most of the returns, on 4H and daily it's good, actually the commission I added 0.002 is relatively large and covers for spread and slippage)
I have seen a strategy with the BB on the 4 hr timeframe. When price breaks upper BB, strategy would go short until MA is reached. Or long when breaks bottom BB.
Yes I have a video on this one it works well this way, check this ua-cam.com/video/f6Nh4guZPRs/v-deo.html
Hi just wanted to say I love the work you did on Rayner teos strategy amongst all the work you put in. Is it ok to ask whether you could backtest a simple strategy with a set of simple rules? It’s a price action strategy. I’ve been confused. (I’m a swing trader who’s doing well in demo/forward testing but I’m struggling with becoming profitable for various reasons one is over holding positions etc, and I’ve heard all types of ways to backtest but just not getting it. apologies for being long winded and I hope my ask isn’t too much. Thanks in advance.
Hi, thank you for your support, send me the conditions of the strategy, I will make a video if it's interesting. If you prefer to send an email it's codingntrading at gmail com
Hi, no pressure. Just wanted to let you know that I’ve emailed you and was wondering if you’ve seen it by any chance. Thanks again
Hi I've seen it among others, not managing well to be honest 😂
Wow I can imagine. I can tell it’s been overwhelming. Do you have any solution to that?
what if you use crypto with "heavy" coins like BTC or ETH and even "crazy" coins like meme coins, AND Long and Short?
how would that go?
I wasn't trying much with crypto but you are right, actually the advantage with crypto is that the volume data is centralized so we can use the volume information also for trading... more videos :)
@@CodeTradingCafe That would be great to see.
Thank you!
Hi testing please this strategy next time from (serious backtester, Consistently Profitable Trading Strategy! 200,000+ Trade Backtest! Best Results Yet!)
It rings a bell, I probably have the code somewhere because I remember the video. I will check it out and make something if the results are interesting to show.
He said this strategy is the best he has seen.
yes I recap, there is only one way to find out :) let's add it to the list
So if I have a Binance trading bot that fetches data from the Binance API, then calculate the bollinger_bands with that data, I will have different amounts than TradingView for example?
Meaning -> working with Binance API data will make my plot different than the one in TradingView after adding a BBand per say?
The data might be slightly different but actually it's the BB computation that might be very different depending on which formula the platform is using, but if you are getting just price data from the platforms (Binance and TV) and you compute the BB in python let's say using the same approach then there is no reason to see large differences.
I saw an interesting video a few weeks ago from Nick Shawn - how i make money trading, even when i’m wrong. Might be good to try and automate this in python and see how it works out in a live trading scenario. An algo shoud easily be able to work out the optimum position size
Hi, thank you for the tip, yes I think he focuses more on the trade management side which we/I should start considering for the videos here.
That's a manual strat, you can't code human discretion.
I find your results to match the potential flaw in your implied thesis on this test. You assume this will detect opportunities in already bullish markets. But the screen shot is trading sideways, like a commenter already pointed out. This in turn means the band should be relatively stable as volatility is relatively uniform. Now a rally starts the band shoots up, now you only look for confirmation for this bullish inclination and there you go. At the same time if you want a warning signal against a market shift this looks like it would warn you of a turn in the market's behavior which would typically end in a price correction that causes draw down in a long only strategy. I think this is more of change of pace detector then anything. This in turn means looking for bullish signs in a bull market will not yield an edge on outright holding. Imagine you have a strategy that uses IV changes to deduce good entry points, well a short squeeze like GME will screw you royally because you are not looking for it but you dont filter it out. I hope this helps to illustrate my point
Thank you for your detailed comment. I agree that the current test conditions in a sideways market might not highlight the full potential of the strategy, it's true that the indicators are showing more the start of a potential rally. Your example of IV changes and the impact of events like short squeezes is also very relevant. This means that we keep the indicator but we will use it for completely different purposes now... looks simple but it gets complicated very quickly :)
For a strategy to be 'successful' it needs to a) outperform buy and hold b) have a lower max drawdown than buy and hold. Many so called 'strategies' are profitable but they are not good enough to out perform 'buy and do nothing'. You can buy the close and sell the open on SPY and be profitable... but massively underperform B & H
Hi, I agree, in principle yes, but no realistic strategy will beat a buy and hold on strong and always long stocks, like Amazon, apple, MS, SP500... historically on a monthly/daily timeframe these were always trending up with some retracements, it's very exceptional if a a strategy can beat B&H on these stocks. But in principle yes I agree with you on the 2 rules especially drawdown often disregarded in backtesting. That being said, the strategy in this video is a very bad one 😂
I need a help any one please
in Backtesting py how to use " limit " in self.buy()
When you pass a buy or sell you can use the limit parameter and provide where at which price the limit is placed: self.buy(sl=sl1, tp=tp1, size=self.mysize, limit=limitvalue)
@@CodeTradingCafe is limitvalue just a number?
if I add current candle high as limit and next candle go above that price what is the entry price?
entry price = limit price or second candle's open price?
It's the entry price that you entered that will be taken into account as entry.
It doesn't look like this strategy is good for trending stocks, on the screenshot it doesn't look trending up, it looks like it was sideways for quite a long time before breaking up. In general trending stocks would have a hard time breaking the channel, because the channel will be very large. I would rather expect breaking channel from stocks that don't change a lot, so the channel is small, but for some reason they get attention and price rockets up high.
You have a point, it also depends on which BB channel we use, all in all I don't think it's a stable strategy, signals are not really clear to me.
Good video! Thanks.
Glad you liked it! Thank you for your support.
hi, you will never get singnal for this strategy in highly liquid stock. only low flot stock show this kind of movement.
I agree, I noticed it highly depends on the channel width, but since the original video used 4X standard deviation I had to try it, but it's way too wide for a break out to happen. So yes no signals most of the times and for a lot of stocks.
Yes but can you please implement the leverage in the next video because the backtesting changes dramatically with just 30 leverage
I could, if you are running the code actually it's very simple to modify the margin ratio so the leverage, otherwise I will keep it in mind for future videos, But I personally don't like high leverage it's not sustainable.
Why don’t you ever look at research papers instead of UA-camrs for results, as often research papers often have proper back tested results compared to UA-cam just being mainly a entertainment platform
Please! Provide some examples for us rookies. 😉
I hope my answer will not sound harsh, I have published numerical/modelling papers (over 65 academic papers, mostly in physics) and I am really familiar with the scientific/academic world. In this field (trading and backtesting) I found more interesting approaches than academic papers here on YoouTube (I repeat... in the field of trading only), more pragmatic and straight to the point. That being said, I still read financial research papers (average 2/week) to follow what's happening, now everyone is tweaking Machine Learning but nothing interesting so far. What I found interesting are books (some are useless though, but other can bring some inspiring ideas).
@@CodeTradingCafecould you suggest which books ?
Robert Carver's are a good start
I've tested a lot of strategies from papers and most are garbage tbh. Luckily de prado brought more light to the problems within the academic realm of financial research.
Hi Ziad. I do not think it is a good strategy. For a strategy to be considered as viable it should perform at least 2x better than the buy and hold approach.
Hi, it's hard to beat the buy and hold for stocks who had a long term uptrend (daily timeframe) because a buy position keeps earning profit. But I agree with you that the strategy is really bad, at first the indicator showed 0 signals I had to tweak it to get a signal out, so it's all unclear.
@@CodeTradingCafe yes I see your point. We should think about something like a trailing stop in order to stay in the trade longer. The ATR is good approach and we could use it as our trailing stop. I do not know how I could program it in python though (yet hehe). The idea for a long trade is that once the ATR is set to not go lower, only higher as price moves higher and remain 2 ATRs below the highest price. So practically trading without take profit. Only a moving stop loss.
I can see that you didn't watch the full video :) hmm check the code the trailing stop is there, I used both a percentage trail and an ATR trail in the code (download file I mean, the video only shows percentage trail stop).
@@CodeTradingCafe haha you caught me, I skipped to the results and did not watch the rest of it.
My opinion on these type of startegies is that they are super stupid and A waste of time
You might be surprised to see a very simple (super stupid) strategy working well on a real account. I tried very complex strategies including Machine learning, neural networks ... simple works best (not the strategy in this video though), and it's much easier on higher timeframes.