Rayner Teo Bollinger Bands Strategy Backtest In Python High Return

  Рет қаралды 51,043

CodeTrading

CodeTrading

Күн бұрын

Пікірлер: 167
@newbienoob1
@newbienoob1 2 жыл бұрын
First comment 🙂 thank you sir i will backtest this on forex and indices
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Good luck, let us know if you find anything interesting!
@aaronsarinana1654
@aaronsarinana1654 2 жыл бұрын
Great! As you mentioned, it'd be interesting testing on a lower time frame to see if it is still consistent. Also, trying the strategy on a portfolio with stocks picked from the s&p500. I think it's worth playing a bit more with the strategy! Great video, thanks!
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you, yes it's very rare to get a constantly increasing equity on a backtest. Bbands are great entry signals.
@lgbpinho
@lgbpinho 2 жыл бұрын
You can use the rolling() method of pd.DataFrame to check the EMA condition: stockData['trend'] = [ 1 if (window.close > window.ema).all() else (-1 if (window.close < window.ema).all() else 0)] for window in stockData.rolling(5)]
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thank you yes there are ways of doing things in Python. ... it's a nice comprehension!
@Asparuh.Emilov
@Asparuh.Emilov 2 жыл бұрын
Watch out for the cancelling of order thing in the strategy. In real trading there is no cancellation of the position, only close. So I am not sure in the backtest what it means to cancel an order but this potentially can be something that might confuse you about the real strategy performance.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi thank you, in real trading you can cancel an order as long as the position is not opened yet, I have done many times, it's an order but doesn't mean an open trade yet.
@Asparuh.Emilov
@Asparuh.Emilov 2 жыл бұрын
@@CodeTradingCafe got it! Thank you!
@davidsaurel4012
@davidsaurel4012 2 жыл бұрын
A limit order can be canceled until a trade is opened
@patelsunilg
@patelsunilg 8 ай бұрын
But in 0% price gap most likely trade will execute and position will be open. What to do in that case ? Secondly in if condition you have checked if zero trade count then closed them wonder how condition will be satisfy since you closing the previous trade after the condition is true ? Is it something specific to library which I’m missing. Btw, Thank you so much for sharing!!
@rami20102015
@rami20102015 2 жыл бұрын
i hope you explain next time for Histogram MACD indicator in python , that i want to know how many red/green stick in histogram that give me the third or forth stick another color to get signal for bot. I wish you understood me .
@MrSamyWageh
@MrSamyWageh 2 жыл бұрын
Another excellent informative video. Many thanks!.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your support, it's great to have you on board.
@mathewz7434
@mathewz7434 2 жыл бұрын
would you try backtesting priceaction strategies such as fakeouts and retest of prices?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Why not just let me know if there is a specific strategy to inspire from. Thank you for your comment
@mathewz7434
@mathewz7434 2 жыл бұрын
@@CodeTradingCafe An example could be turtile soup strategy and Fair value gaps
@mathewz7434
@mathewz7434 2 жыл бұрын
@@CodeTradingCafe also top down analysis of the charts
@danielsegundo6734
@danielsegundo6734 4 ай бұрын
Well done. You might consider using a parameter based on ATR instead of just a strict percent in your addorderslimit function. This should generalize the system to more instruments that have less percentage-wise volatility.
@CodeTradingCafe
@CodeTradingCafe 4 ай бұрын
Hi Thank you, I used ATR later on in some of the strategies, both ATR and percentage based are a quick way to run the test. Thanks again for your support!
@a.winath4024
@a.winath4024 2 жыл бұрын
THANK YOU AGAIN FOR YOUR EFFORTS! :-)
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Happy you are still interested, thank you for your support 😊
@gokhalesadan
@gokhalesadan 2 жыл бұрын
Helpful video. Please make a video, detail of backtesting package and how to customize use.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your comment, did you check my python learning playlist?
@lecerclecrypto
@lecerclecrypto 4 ай бұрын
Are there only long trades ? I don't see some short. In a trend market, always doing buy position will make a winning strategy if you don't uses leverage but can have some hard drawdown and pains. I cannot tell that is a winning strategy, or it will if working on day trading strategy.
@CodeTradingCafe
@CodeTradingCafe 4 ай бұрын
Hi I partially agree, but I think the bollingers are helping in detecting good entry points.
@lecerclecrypto
@lecerclecrypto 4 ай бұрын
@@CodeTradingCafe Yes they did. Like MA and others. But a strategy have to take care about the economic events. It is very import on some days because that could occurs on big draw down (or unexpected rewards), or bias signals statistics. But in swing strategy I understand the effect is lesser than in day trading. VWAP std dev also are good, or even more interesting than Bollinger. The main idea is to maximize win/loss ratio and risk/reward and then finding the better entry point. I found more difficult to find a good exit than a good entry. It could literally changes all your results.
@CodeTradingCafe
@CodeTradingCafe 4 ай бұрын
Totally true the exit is the hardest to guess and it plays a major role on the returns.
@jensasp4326
@jensasp4326 2 жыл бұрын
Great! as always :-) thx ..... how about Super Trend indicator as confirmation/exit - e.g. on a lower timeframe, like 30 minutes exit test, to a 4H entry signal algorithm ? ... and one suggestion to upcoming video's, is an example on how to use the heat map function in backtesting.py, to loop through parameter settings, or the multi timeframe functionality (related to the exit on lower timeframe, than the entry) ... many thanks, for your excellent stuff!
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your comment, yes I should check the heatmap I like visual gadgets... For the entry/exit can you elaborate with a quick example?
@jensasp4326
@jensasp4326 2 жыл бұрын
@@CodeTradingCafe Hi again :-) I Think my idea is that the primary timeframe to entry signal is 4H and then I would use the 30M to determine confirmation/Exit, like this: (a) download 30M data, Calculate the Supertrend on this data (b) resample data to the 4H timeframe (updated every 30 M) (c) Calculate Entry (BUY or SELL) on the 4H data (d) store this, and if the signal within 3 x 30 minutes is aligned with the Supertrend direction, then entry (e.g. confirmed) (e) Exit when the 30M change direction ..... the idea is, that the 4H shows the trend better, which gives the entry - and the 30M supertrend confirms the direction of the entry signal, and is used for a more precise exit ....
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@jensasp4326 thank you for the explanation, yes I see what you mean I will think about how to code it and maybe additional indicators on top...
@leandrorodrigues3488
@leandrorodrigues3488 Жыл бұрын
That has few opportunities over time, with high “win rate”. However you have 500 tickers in SP500 to find 1 per day.
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi, yes it's hard to get more on the daily timeframe, it would've been nice though because large timeframe have higher return/spread ratio.
@leandrorodrigues3488
@leandrorodrigues3488 Жыл бұрын
@@CodeTradingCafe i’d create a screener running this strategy every afternoon after market closes for the 500 ticker’s. Once I have a sign to get in I receive a note to trade next day, according to strategy. That may have at least 1 sign per week, considering 500 tickers.
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
I agree I do something similar on my real account a screener that sends me an email when a 'rare' opportunity is on the market, then I check it out for confirmation. I did a video on this in the past and I can't seem to find it now (which means I should tidy up the playlists). Thanks for your input!
@leandrorodrigues3488
@leandrorodrigues3488 Жыл бұрын
@@CodeTradingCafe i also added a stop loss of 5%. That decreased win rate, however in some tickers, some trades you can have 30% loss. Too dangerous for me
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
@@leandrorodrigues3488 I agree 30% is too much. But doesn't your 5% SL limit the loss ?
@kachunpang7543
@kachunpang7543 7 ай бұрын
Why do Sharpe and volatility in the result (time 1:00 ) is NaN? What does that mean?
@CodeTradingCafe
@CodeTradingCafe 7 ай бұрын
Sharpe uses data time as index, if the index in our dataframe is just an integer then we get Nan meaning non numerical value.
@jigneshsoni9263
@jigneshsoni9263 Ай бұрын
do you have a video that show how to setup the automation to trade on a real account with various brokers?
@CodeTradingCafe
@CodeTradingCafe Ай бұрын
The closest I have to your request for live trading in this one: kzbin.info/www/bejne/mIvLpamse9JkbaM (One broker, One asset, live trading, but you can easily extend the code to multiple assets)
@happystoat99
@happystoat99 Жыл бұрын
I just tried this notebook on a bunch of forex pairs as well as one stock (Tesla) for the last 10 years and all lost money, sometimes a significant amount, except for USDEUR, GBPSGD and GBPCHF. Is anyone else getting the same disappointing results? Or is this a strategy specific to stock indexes?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hey, parameters have to be tuned for each stock/currency and still no guaranteed results. The best is to choose a stock or a currency git the strategy parameters on 5 years of data to get best results and then test the parameters on the last 5 years. Even better, fit on 10 months and test on 2 months consecutively for 10 years then aggregate the returns for the results. I know it's a lot of work but this is a good way to test if a strategy is valid. (and in reality higher margin leads to higher returns but also higher risk). Trade safe!
@jordanfong4255
@jordanfong4255 11 ай бұрын
lots of look ahead bias, such as taking the next recent order instead of the initial order. As well as increasing/decreasing the order closing price to show a better fill price. Not sure if this would produce good results in a real world scenario.
@CodeTradingCafe
@CodeTradingCafe 11 ай бұрын
Hi, thank you for your input, can you please locate where the look ahead bias is occurring? I mean in the code (it does provide good results in real trading, but it's very slow, too little trades)
@fernando1296
@fernando1296 Жыл бұрын
Teacher, Have you tried the "Donchian Channel"? Is it more effective than the "Bollinger Bands"? It would be interesting to do a "versus" Regards!
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thank you for sharing, in my opinion they are almost there same as bollingers. I don't think much difference will be seen in the results.
@AMA_RILDO
@AMA_RILDO 2 жыл бұрын
Hey mate, have you ever thought to open a discord group for all you fans? would be amazing for us
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi, I did open the account, was never ready to share it and start taking care of it, to be honest I am not sure I will have more time to follow up, someone also asked me for a GitHub share which I also did but never had the time to migrate my codes which need a lot of sorting at this point. I guess I didn't expect that much work from such a small YT channel 🙂 but you are absolutely right it's maybe time for a discord.
@bondbenz6375
@bondbenz6375 4 ай бұрын
hi, thank you for the great videos you make, i just have one question, what about the spread? if you try to include it in the backtest, all the results will be different, that's what happened to me when i got live with the algo trading instead of backtesting only, SL hits just because of the spread, thank you again :)
@CodeTradingCafe
@CodeTradingCafe 4 ай бұрын
I think the algo must be adjusted for live trading. Spread can be counted in the backtest by adding some commission amount.
@akash_ray_trading4413
@akash_ray_trading4413 2 жыл бұрын
Coding file not available please help
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hey sorry I just checked it should be working there doesn't seem to be a problem
@Om-VasudeV-108
@Om-VasudeV-108 8 ай бұрын
Is this available as a web-based applications
@CodeTradingCafe
@CodeTradingCafe 8 ай бұрын
Hi, unfortunately not, it's just testing strategies on historical data in Python, so you need Python installed to run the code files.
@Luca-wg4cv
@Luca-wg4cv Жыл бұрын
but to run it on alpaca say what else I have to write?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
You will have to go through their API documentation to check their specific functions, shouldn't be hard but it might take time.
@Luca-wg4cv
@Luca-wg4cv Жыл бұрын
@@CodeTradingCafe Can you tell me code to make this strategy work with alpaca bees? Or any other broker?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
In this video I share a code running a bot with OANDA check it out, it might be helpful kzbin.info/www/bejne/jZTJfJSQgZmppqM
@teenspirit1
@teenspirit1 Жыл бұрын
To people who are about to waste their time with the video: SPY 2011-2017 is basically a straight line. it is not a useful instrument to test any strategy. If you still want to watch it fail, try testing on 2022 or 2023 or any instrument that doesn't go up in a straight line.
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
In algorithmic trading different strategies serve for different markets, in a trending market this one works well, there is no one strategy fits all especially if it's fully automated, at least I haven't seen one in my 15 years of numerical modelling. On the other hand, if you have ideas that would improve our results, please share those with us, I can test those for you.
@optionbuyside3483
@optionbuyside3483 10 ай бұрын
Great leaning
@CodeTradingCafe
@CodeTradingCafe 10 ай бұрын
Thank you for your support!
@squadgang1678
@squadgang1678 2 жыл бұрын
i didnt understand the part in addmasignal function where you used upt == 1 and dnt==1: then you insert value as 3 and print trend loop what do you mean by trend loop? and in some places of EMASignal value is 0 what does 0 indicates?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi, 1 means downtrend, 2 uptrend, 0 no clear trend and 3 for faulty algo we shouldn't be having 3 normally.
@squadgang1678
@squadgang1678 2 жыл бұрын
@@CodeTradingCafe ok thank you
@whyyoutube8197
@whyyoutube8197 2 жыл бұрын
Could you test all of Tradingwarz strategies please
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
will add it to the list, I am not familiar with this model so might take some time.
@whyyoutube8197
@whyyoutube8197 2 жыл бұрын
@@CodeTradingCafe sure thanks for the reply! Tradingwarz has roughly 4 different strategies that may or may not be used together. I suggest you backtest them separately. 1) 3 min / 5 min ORB after a gap (can be any direction). Enter when second candle breaks in either direction. Stop loss at the high/Low of the opening 3 or 5 min candle. First profit tartlet at the -0.272 level on Fibonacci retracement (can edit Fibonacci retracement on tradingview). Thereafter your take profit is up to u I think. 2) “Trigger trades” based on previous day’s range. From daily timeframe, draw Fibonacci retracement from Low to high if daily candle was green or high to Low if daily candle was red. Add custom level 0.9 and 0.1. Take the trade when price either breaks the 0.9 or 0.1 level (direction depending on whether u draw from Low to high or high to Low). First take profit is previous days high. Thereafter the take profit is up to you. Stop loss at the 2nd closest Fibonacci level. Eg. If price breaks 0.9 level, stop loss at 0.618 of the fib you drew. 3) Pure Fibonacci. On the 3 or 5 min chart, wait for price to develop about for about 15 min. Thereafter, draw the fib retracement from the current swing Low to high or high to Low depending on the directional move. Set limit order at the .5 retracement or .618 or .786 retracement. Stop loss is the 100% level of your fib. Suggest you backtest the 3 levels separately and also one more backtest where you average in whenever each level is hit. First take profit is current high/Low of the day and thereafter up to you. Suggest 1.5 RR for the 2nd take profit. 4) “Fractal” trades. He takes trades off either break of single inside bar, single outside bar, double inside bar, outside inside or inside outside bar on the 3, 5 or 15 min chart. Generally such a strat would have a lot of false signals so I suggest taking those trades only at key levels (HOD/LOD/Support resistance/fib levels). Stop loss is high/Low of the above mentioned bar that was broken.
@ΠαναγιώτηςΛουκοπουλος-ι7β
@ΠαναγιώτηςΛουκοπουλος-ι7β Жыл бұрын
Congratulations for this perfect strategy but how I can do it to for live trading?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi, thank you, check my recent videos for live trading bot with oanda, I made one simple example like a month ago.
@ΠαναγιώτηςΛουκοπουλος-ι7β
@ΠαναγιώτηςΛουκοπουλος-ι7β Жыл бұрын
@@CodeTradingCafe thanks for replying I apriciate I will checked 👍🙏👏
@ΠαναγιώτηςΛουκοπουλος-ι7β
@ΠαναγιώτηςΛουκοπουλος-ι7β Жыл бұрын
@@CodeTradingCafe excuse me for this is not correct but i do to you this answer because i see you have a lot of knowledge's and i know you like this and you replyng. I have try to do a simple bot for training and if i can to do it to work to copy your strategy but i have the last error and i dont know how i can fixet. The error is this: FutureWarning: In a future version, object-dtype columns with all-bool values will not be included in reductions with bool_only=True. Explicitly cast to bool dtype instead. dfx = pd.concat([dfx, mask], ignore_index=True). If you wont answer to me. thanks in advance I have try this parameter: [dfx = pd.concat([dfx, mask], ignore_index=True)] but i take a lot of errors back THIS IS THE CODE: class Signals: def __init__(self,df, lags): self.df = df self.lags = lags def gettrigger(self): dfx = pd.DataFrame() for i in range(self.lags + 1): mask = (self.df['%K'].shift(i) < 20) & (self.df['%D'].shift(i) < 20) dfx = dfx.append(mask, ignore_index=True) return dfx.sum(axis=0) def decide(self): self.df['trigger'] = np.where(self.gettrigger(), 1, 0) self.df['Buy'] = np.where((self.df.trigger) & (self.df['%K'].between(20,80)) & (self.df['%D'].between(20,80)) & (self.df.rsi > 50) & (self.df.macd > 0), 1, 0) if you can give me the key to start this bot I'll be auspicious Thanks in advance
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
@@ΠαναγιώτηςΛουκοπουλος-ι7β Hi, the message you are getting is a warning not an error, so it should work. And anyway it's pointing to a code line that's different from the class you shared. I hope this helps.
@ΠαναγιώτηςΛουκοπουλος-ι7β
@ΠαναγιώτηςΛουκοπουλος-ι7β Жыл бұрын
@@CodeTradingCafe thanks you so match for replying yes you have right but when I go to start the bot coming this messenge Instead of displaying the bot's transactions and details I receive this message 1 million times 
@leobike-1920
@leobike-1920 Жыл бұрын
hi bro, is this strategy applicable for 30m timeframe with bitcoin trading ?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi I think 30 min is maybe too low but there's only one way to find out :)
@top10top54
@top10top54 2 жыл бұрын
Try bactesting priceaction strategies for forex, most of the strategies have high win rates
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
You mean from Rayner Teo? I will check it out, and if you have links to yt vids let me know. Thank you again
@top10top54
@top10top54 2 жыл бұрын
Yes also rayner teo teaches price action strategies in his book. Example of price action is on this link kzbin.info/www/bejne/f2LSZpyeoJaSfMk
@anderwork7571
@anderwork7571 2 жыл бұрын
good shit bro
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Lol indeed
@sukriadnansangadji8232
@sukriadnansangadji8232 Жыл бұрын
please explain the code, how to code to reOrder_long when the price is bullish or trend up. I want first order 5% second order 20%, and so on
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi, thank you for your comment, I am not sure I understand what you meant, can you please elaborate.
@arireimers6451
@arireimers6451 9 ай бұрын
does this backtesting strategy work for every trading strategy
@CodeTradingCafe
@CodeTradingCafe 9 ай бұрын
I guess so provided you code the indicators properly... and the trade signal of course.
@rami20102015
@rami20102015 2 жыл бұрын
thanks sir for what you teach us
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your appreciation, enjoy the learning process!
@tudatostrader
@tudatostrader 2 жыл бұрын
Hey Mate! Amazing videos! May I ask where are you from? I'm trying to figure it out from your accent. Poland maybe?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi thanks a lot for your support, not Poland take another guess 🙂 it's going to be hard because I have a mix of accents coming at different times.
@tudatostrader
@tudatostrader 2 жыл бұрын
@@CodeTradingCafe Okay, just to get a hint. Are you from the EU?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@tudatostrader yes but not only, I partly understand polish Italian and Portuguese, and fluent in English French and Arabic. I will let you guess 😂
@asarechrisford2928
@asarechrisford2928 Ай бұрын
I don't know how to generate your code into mt5 and backtest. Can you help me? Also can you create an EA code on exponential moving averages. Thank you. Waiting for a feedback soon
@CodeTradingCafe
@CodeTradingCafe Ай бұрын
Hi, unfortunately I dropped coding mql a while ago, but I am sure chatGPT can translate code very well. Exponential moving averages are a bit vague if you have a specific strategy I can check it out.
@asarechrisford2928
@asarechrisford2928 Ай бұрын
@@CodeTradingCafe pin bar hitting 200 EMA, or 50 EMA on 1hr or 4h time frame following the 4h trend
@asarechrisford2928
@asarechrisford2928 Ай бұрын
@@CodeTradingCafe can you send me the link to that video. I copied your code to chat gpt but after running it on mql, there were errors which invalidated the code
@kanaya1991
@kanaya1991 2 жыл бұрын
hi bro! im a question about backtesting, were can i learn how in python? im new in python and im learning hard! cheers from argentina!
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi, check this playlist it might be helpful Python Learning: kzbin.info/aero/PLwEOixRFAUxZVV0XNWlapem1yoRA4rt_O Backtesting, the best is to read the backtesting.py online manual
@sanjlakhanpal5017
@sanjlakhanpal5017 6 ай бұрын
I luv yr channel
@CodeTradingCafe
@CodeTradingCafe 6 ай бұрын
and my channel loves you :) thank you for your support
@santhoshdasari7
@santhoshdasari7 2 жыл бұрын
Thanks you 🙏
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your support 😊. Good luck to you.
@pablolecce6931
@pablolecce6931 2 жыл бұрын
A little advice to increase your views. When you are showing a function that you used in previous videos, if you remember the video, you could say: "I will not talk about this function here, but if you wanted, you could see it in this video". This sounds more amiable and the people continue watching your channel that is what youtube algorithm wants and because this they are going to bring you even more views. ;)
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Now I am curious to know what I said in this video 🙂 I hope nothing too bad. Thank you for the heads up.
@pablolecce6931
@pablolecce6931 2 жыл бұрын
@@CodeTradingCafe No, no bad. I understand your words because in the moment you don't want to explain again part of the code. For this reason I am making a suggestion (based in my knowledge) about how you could use your tireness explaining part of the code into an useful asset. Don''t worry. Was fine.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@pablolecce6931 thank you for your answer, actually I always hesitate if I should explain again for new viewers or I should simply refer to another video.
@pablolecce6931
@pablolecce6931 2 жыл бұрын
@@CodeTradingCafe For example, see how this guy recommend another videos in the minute 9:22. This is a great way to do ir and mantain the people engage with your channel. kzbin.info/www/bejne/rqOteKZ3epKhrJo
@pablolecce6931
@pablolecce6931 2 жыл бұрын
@@CodeTradingCafe You're welcome. Is always an honor help people that try to help me
@ventiladorbueno1846
@ventiladorbueno1846 2 жыл бұрын
Thank you
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Ventilador still here! Thank you ,🙂
@hourglass9
@hourglass9 Жыл бұрын
Great Video! Can you simultaneously do a backtesting on all 4 symbols like for example EURUSD and SPUSD so if I buy on SP500 on 2011-01-07 and sell on 2011-01- 10 then in the next buy this program will recheck the opportunity in EURUSD and SPUSD and automatically matches the buying signal and then buy that stock after 2011-01-10 in this way we can have a full return on investment 😀
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi good idea, we can simply backtest each asset on its own and aggregate the results for the same time window. I am not sure if this answers your question correctly.
@hourglass9
@hourglass9 Жыл бұрын
@@CodeTradingCafe Hi Thank you for your reply. For example if I invest $100 in AAPL then once I sell AAPL I scan the market and see which stock is fullfilling the buying condition that I had then for example if it is their in MSFT stock I will buy MSFT so over multiple stocks if I want to test my backtesting strategy to see my return in a year. so I dont want to backtest each asset but like multiple asset but on a single timeframe like if i used this strategy in 2010 and 2011 then how much will my return be over investments on different stocks....Would that be possible?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Now I get your point, I am not sure backtesting allows this I will have to look for a way around, but I am also thinking if it works how to deploy it in the live version... tricky I admit
@hourglass9
@hourglass9 Жыл бұрын
@@CodeTradingCafe Exactly. Thank you!🙂
@harrymaltby5060
@harrymaltby5060 Жыл бұрын
@@hourglass9 They tend to run as a group, I track 30+ daily and trade on those and 85% to 95% always do their run together so investing in your choice, tends to block going into another. So spotting the buy and sell points of multiple stocks with one against the other as if the money is flowing back and forth between the two is exactly difficult but exactly what I have wanted but doesn't seem to happen that often. Personally, I am hoping that potentially pulling in the MACD, etc. into the NN finds my one stock choice, one at a time. I should not talk though, I am loosing some on XPO at the moment!
@mehdimalek309
@mehdimalek309 7 ай бұрын
Daily !! Really? Can I use it on 5M ?
@CodeTradingCafe
@CodeTradingCafe 7 ай бұрын
Hi why not Daily? it's my preferred timeframe
@VonSchelzen
@VonSchelzen Жыл бұрын
Fantastic
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thank you;
@borism4849
@borism4849 2 жыл бұрын
You're underperforming a simple buy-and-hold strategy. Where is the alpha?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
some of these strategies work well some don't, can't know in advance, gotta try them and share them for those learning around in python.
@macrocreationbiz
@macrocreationbiz 2 ай бұрын
I have run this on the 15minute time frame and it gets a 50% win rate using SOL
@CodeTradingCafe
@CodeTradingCafe 2 ай бұрын
Good to know, thank you for sharing this, you might want to check other parameters as well see if it's really on the positive side of the market. Good luck!
@macrocreationbiz
@macrocreationbiz 2 ай бұрын
@@CodeTradingCafe ETH/USDT on the 1 hr seems to be a good play as well. Just deployed to SOL/USDT bot.
@Krisler12
@Krisler12 2 жыл бұрын
Hi! I have just posted a comment with a very good idea. Why it is not visible? Please read it and say what you think because it is an amazing thing.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi, thank you, if the comment has a link KZbin filters automatically thinking it's spam.
@Krisler12
@Krisler12 2 жыл бұрын
@@CodeTradingCafe Posted it again. Please give an answer.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi I still can't see it, if you included a link it will be automatically filtered by KZbin
@Krisler12
@Krisler12 2 жыл бұрын
@@CodeTradingCafe Go to the Crypto Wizards channel and check for the last video. It is a video about Gaussian mixture model in its title. Have you find it?
@Krisler12
@Krisler12 2 жыл бұрын
@@CodeTradingCafe Did you find it?
@arturio10
@arturio10 10 ай бұрын
It’s easy with 0.0 fee 🤦🏻‍♂️
@CodeTradingCafe
@CodeTradingCafe 10 ай бұрын
Yes and no, I don't find it easy, even without fees. But just to mention a detail here, on daily timeframe fees are negligible, for example CFI brokers offer 0 overnight fees for FOREX trading, so you basically pay only the spread and a s;all fee when you open the trade, if you compare these with daily price movement... peanuts. You just need the correct broker, the correct account, and the correct timeframe.
@CarlosJa
@CarlosJa 2 жыл бұрын
I prefer in php..
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
I am afraid that would be impossible 🙂
@CarlosJa
@CarlosJa 2 жыл бұрын
@@CodeTradingCafe why would it be impossible.. I built a backtester in PHP.. Which runs faster than python.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@CarlosJa it might have been more effort though, the advantage of Python are all the built-in libraries makes your work easier... But again if you feel comfortable with php then you are right why not.
@CarlosJa
@CarlosJa 2 жыл бұрын
@@CodeTradingCafe phptrader has built in trading libraries too.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@CarlosJa oh! I didn't know that to be honest! I think a whole world happening outside of python 🙂
@React2022-u7l
@React2022-u7l Жыл бұрын
poo
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
thanks, supportive still :)
@moonbind
@moonbind 4 ай бұрын
in the end, all fails and they made video only for views, full bunch of youtube trash "artists" who can't answer for their delusional claims;
@CodeTradingCafe
@CodeTradingCafe 4 ай бұрын
Hi, I am not sure if it's me you're referring to :) but just to keep the numbers right the 1689% was obtained as an experiment where I increased the leverage too much so also the risk is unrealistic. But I think if we decrease it to a reasonable ratio (1/5) this strategy might work on trending stocks but the returns will also be decreased.
@randev7391
@randev7391 2 жыл бұрын
This is my second profit from their platform I can’t stop Investing till I own the world, I felt it was a scam before but thanks for the conviction I made it through while investing with their platform Also… it’s really a blessing to have such a great platform to earn crypto
@thirupathisalveru5411
@thirupathisalveru5411 2 жыл бұрын
thank you
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your support 😊
@randev7391
@randev7391 2 жыл бұрын
This is my second profit from their platform I can’t stop Investing till I own the world, I felt it was a scam before but thanks for the conviction I made it through while investing with their platform Also… it’s really a blessing to have such a great platform to earn crypto
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Trading with Python: Simple Scalping Strategy
13:47
CodeTrading
Рет қаралды 106 М.
Backtesting Stock Trading Strategies in Python
17:48
NeuralNine
Рет қаралды 39 М.
John Bollinger on Bollinger Bands for MetaStock
1:05:51
MetaStock
Рет қаралды 281 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН