Technical Indicators Comparison Using Machine Learning In Python

  Рет қаралды 26,001

CodeTrading

CodeTrading

Күн бұрын

Пікірлер: 113
@bosypuspus
@bosypuspus 2 жыл бұрын
Its best to select one good indicator from each category such as momentum, trend, volatility and then using them as your input variables. Furthermore, the precision of the model will never be perfect or it wont give you the results you want but this should not stop you as even a low precision can be just as good. This is also know as the Paradox effect. So this means that you have to forward test your model to see how it performs. Moreover, the predictions from the model should be combined with your manual trading strategy for it to be effective and not rely just on the model itself. Also, regarding timeframes, 1D, 2H or 1H are good to train your model as they have less noise but also make sure the model includes the most latest data points because having too many historic data points can be rendered as obselete as the market is constantly changing.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi, thank you for sharing these ideas I agree that testing a model is the best way to see how it behaves but this is not feasible on a daily timeframe with that little signaling, it would be too little trades to judge... However on hourly timeframe this might be doable. I will look into it and keep some of your propositions in mind for coming videos. Good luck to you
@RealLexable
@RealLexable Жыл бұрын
​​​@@CodeTradingCafeyou can even use 1Min timeframe if you consider the previous statement about the categories mentioned above. The combination and evaluation of every 5 different indicator types together is the golden key here. Trend, volume, oscillator, volatility and sentiment and additional perhaps also a secret mathematical formula on each of them around 🎉
@ArjenJongeling
@ArjenJongeling 9 ай бұрын
I’ve also been thinking of machine learning in trading. My idea is to use a genetic algorithm to find the ideal parameters of an indicator or set of indicators. You say you hard coded a length of 16 for the MACD out of habit but A.I. could figure out what length has the best results. Maybe 4 or 78, who knows?
@CodeTradingCafe
@CodeTradingCafe 9 ай бұрын
Yes you are right, but this brings a new problem "overfitting" it's well known in ML and the whole exercise is to keep the ML model working while reducing overfitting, it's just finding this sweet spot in the middle if there is any. I am preparing an optimization video now I hope to finish it for the next week, it's not ML but it does what you say finding the best set of parameters. Let me know when it's out, what do you think about it.
@navidfarshi
@navidfarshi 3 ай бұрын
i am new in this field, please guide me which is the best approach to predict TESLa ? where should i start?LSTM?
@CodeTradingCafe
@CodeTradingCafe 3 ай бұрын
Hi, I think at first it's better to drop any Machine Learning approach just go for classic coding backtesting in python, classic approaches work better and are much easier to implement. Good luck!
@BoHorror
@BoHorror 3 ай бұрын
This is a bit late to the party, but try adjusting the confidence threshold of the model to something like 0.7, that might help
@CodeTradingCafe
@CodeTradingCafe 3 ай бұрын
Thank you, yes I agree, I addressed these issues in detail in my course, but I think I have to make recent videos here on YT about Machine Learning.
@sodichz
@sodichz 3 ай бұрын
Thanks for sharing, however there are a few points to consider: 1. Normalization 2. Bias (class 0) 3. Correlation
@CodeTradingCafe
@CodeTradingCafe 3 ай бұрын
Hi, thank you for your support. Regarding normalization it's not needed for tree based algorithms (xgboost is based on random forest... tree). But yes I agree it's worth checking how to balance the data and check correlations first.
@fredyhazard6412
@fredyhazard6412 4 ай бұрын
I was trying to use yfinance for Tesla, and I got stuck plizz help 😢
@CodeTradingCafe
@CodeTradingCafe 4 ай бұрын
Hi, check this video for data kzbin.info/www/bejne/r6bRgodrbp1pbJY
@QuantFactory
@QuantFactory Жыл бұрын
I appreciate you sharing this fantastic video with us. It would be great if you could create some videos about Deep Reinforcement Learning (DRL). I would like to thank you again for sharing your knowledge with us.
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thank you for your support, reinforcement learning is on my list, the problem is that I will need a lot of time, life is keeping me away from KZbin for a while :)
@courtneylomax7254
@courtneylomax7254 Жыл бұрын
I'm having an issue where panda_ta is imported as pa, I can run help; for example help(pa.rsi), and I can see the parameters, but when I run the cell, it's says "'DataFrame' object has no attribute 'close'", when it clearly does. It is highlighting df.close.
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi, check if the columns names are capitalized, print the dataframe first to see if it's loaded correctly. Good luck!
@ArjenJongeling
@ArjenJongeling 9 ай бұрын
I’ve been developing automated trading scripts in Pine since 2020 and the biggest problem has always been to distinguish between trending and non trending market situations. Most scripts work like a rocket as long as the market is trending. So if your method can predict Category 0 (not trending) with 78% accuracy, it could help other scripts to be active or pause.
@CodeTradingCafe
@CodeTradingCafe 9 ай бұрын
Hi, I have dropped ML in trading because data is usually noisy, but you are right actually maybe just focusing on solving the trend part of the problem might be worth retrying some methods.
@suprakashghosh8909
@suprakashghosh8909 2 жыл бұрын
Many of these indicators are likely to be highly correlated which might be resulting in a relatively poorer model. Besides this, I had the idea of maybe using the close of future candles as the output variable in a neural net and see where that gets me. I think if 4-5 non-correlated indicators can be found, that can result in a very good model.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Yes in fact since they're all oscillators it's very likely many are correlated, the idea of considering closing price of the future candles is good but how many candles do you think we should take on average?
@suprakashghosh8909
@suprakashghosh8909 2 жыл бұрын
@@CodeTradingCafe The very next candle, however I think the timeframe here will be key. If the timeframe is too low, then it's likely the data will be subject to a lot of noise and will give poor signals. On a daily(or higher) timeframe, it might be better.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Yes I see what you mean, actually I could try something similar in future videos...but yes I like the idea of considering the future closing price on a daily timeframe seems legit
@edshrooma8212
@edshrooma8212 Жыл бұрын
i love how you adding python scripts under your video :)
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Helps people learn python.
@mohakaz4157
@mohakaz4157 2 жыл бұрын
Your Video is best. Build video trading about deep learning and ai. Thanks.😍😍😍😍
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your support 😊
@tradercrypto_lad8929
@tradercrypto_lad8929 2 жыл бұрын
Thanks for the video :) would you please provide the csv file also?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi, there's a csv file here kzbin.info/www/bejne/a6nPl3aNe756hq8 basically any csv data file would work provided is the same format
@kibetwalter8528
@kibetwalter8528 2 жыл бұрын
Please send the code
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Yes sorry I forgot I will add the link in the description
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Done link is there
@kibetwalter8528
@kibetwalter8528 2 жыл бұрын
Thank you Is there a way I can contact you?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@kibetwalter8528 Hi, drop me an email it's in the about page of this channel.
@anatolyalekseev101
@anatolyalekseev101 Жыл бұрын
imho it makes no sense to train without early stopping (eval_set param).
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi, thank you for sharing. I think it depends on the model, but I will recheck this maybe read the docs and see if I can find info about it.
@anatolyalekseev101
@anatolyalekseev101 Жыл бұрын
I conducted a few experiments with boostings as well, all revealed that without early stopping models overfit severely. Maybe something simpler would not, but boosted trees seem to be too powerful. I think re-running your setup with early stopping (that is, further dividing train set into "real train" and "val" subsets, and providing "val" subset as eval_set param to the .fit method along with early_stopping_rounds=someint, and "real train" as X and y) will improve model stability and even highlight other features as important. 63% train ->37% test acc drop is a sign of huge overfit, rendering conclusions unreliable. I mean, who wants to know what features an overfit model thinks are important. We want to know opinion of a model that is capable of beating DummyClassifier, at least ) Otherwise, great idea to test indicators like this.
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thanks a lot for taking the time to detail this issue. Now I see the difference between train and test acc (don't know why I missed it at the time). But yes you are right boosting here is maybe an overkill needs to be kept under control.
@vv9730
@vv9730 Жыл бұрын
10:20 accuracy is shown as 63 %..how much accuracy should be considered strong ..70-75+?? how to increase this accuracy ..??
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi, it depends on your stop loss and TP levels. if they are equal distances then anything above 55% is excellent, it's really strategy dependent.
@Dr.jayfrancis
@Dr.jayfrancis 2 жыл бұрын
Very rich thanks.. i see that your channel is booming !
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your support 😊... Booming maybe not but I am happy viewers are interested
@sanjeetmohanty3894
@sanjeetmohanty3894 8 ай бұрын
Isn't the technical indicators in the test set a function of the actuals? when predicting future these wont be available and need to be forecasted/extrapolated?
@CodeTradingCafe
@CodeTradingCafe 8 ай бұрын
Depends how you code it, in this case we consider that at the end of the current candles meaning after the candles closed we already have the current RSI... indicators, I might have made a mistake in the code but the approach doesn't have any look ahead bias.
@anikettawade6015
@anikettawade6015 Жыл бұрын
can you make same video on candle stick pattern to know which candle stick pattern is more reliable. please please
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
I already did few vids on this check the previous videos in this play list, there is the candles patterns and the wick length also is important. Good luck!
@WisdomSeeker776BC
@WisdomSeeker776BC 9 ай бұрын
Hi did you have a video comparision about stop loss setup strategy
@CodeTradingCafe
@CodeTradingCafe 9 ай бұрын
Hi, I had some videos, this one is a good start: kzbin.info/www/bejne/a5WanHuQYreVo68
@musiclover1067
@musiclover1067 Жыл бұрын
Great work!
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thank you!
@HitAndMissLab
@HitAndMissLab 3 ай бұрын
If you don't mind me asking, how long did it take for this Python code to crunch the data? Was it very demanding on CPU?
@CodeTradingCafe
@CodeTradingCafe 3 ай бұрын
Hi, no not at all, it's usually a minute or so with this kind of data.
@HitAndMissLab
@HitAndMissLab 3 ай бұрын
Seriously useful video. Thanks for doing it.
@CodeTradingCafe
@CodeTradingCafe 3 ай бұрын
Glad it was helpful! thank you for your comment.
@wingsoftechnology5302
@wingsoftechnology5302 2 жыл бұрын
Keep it up... 👍👍👍👍
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you
@Forexsignalpro
@Forexsignalpro 2 жыл бұрын
I want an Ai that trades my trading strategy its nothing complicated but im not a coder and need machine learning. A (bot) won't work.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Just to save you money, so far simple machine learning methods don't work well in market predictions, so I wouldn't invest in this if I were you.
@mohammadmujeebsubhani4329
@mohammadmujeebsubhani4329 Жыл бұрын
dm I can help
@rolandmuller6476
@rolandmuller6476 2 жыл бұрын
Can you post the download link again
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
The link is working well, check your firewall settings.
@jeremyross7641
@jeremyross7641 9 ай бұрын
Nice video. Thank you
@CodeTradingCafe
@CodeTradingCafe 9 ай бұрын
Glad you liked it, thank you for your support!
@popovichrush
@popovichrush Жыл бұрын
please i knw nothing about coding can you write my strategy for me and you want regret doing me this favour
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hi most strategies look rewarding before the backtest but are not good for automation... out of experience 🙂
@popovichrush
@popovichrush Жыл бұрын
@@CodeTradingCafe you are right but trust me i knw what am talking about......what i have when you get your hands on it you will stop using all the indicators you have and use mine......all the same if you are not interested i understand but i am interested in your coding knowledge.....i dont want my machine learning to place trades for me but should alert me my conditions are met...can u help me code it?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Well honestly I am always interested and I always learn from others, we can try it just without high expectations at the moment Edit: if you want send me some information by email codingntrading gmail com
@drjenniferderm
@drjenniferderm 2 жыл бұрын
Great video. Thanks
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Thank you for your constant support 😊
@kibetwalter8528
@kibetwalter8528 2 жыл бұрын
Hello. Can CNN be used to make a model to be used in a bot to trade ethereum and cryptocurrencies?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi just a personal opinion, it's difficult to train CNN with very little data and most of it blurred with noise, I think it's going to provide the same result as a neural networks classifier, but there's only one way to find out... Try it out
@kibetwalter8528
@kibetwalter8528 2 жыл бұрын
@@CodeTradingCafe Okay Thank you
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Good luck!
@Turkun-y3l
@Turkun-y3l Жыл бұрын
Great stuff! Thanks
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Thank you for your support! Good luck!
@Forexsignalpro
@Forexsignalpro 2 жыл бұрын
Would you create an AI for me based on my own specifications?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi check my other answer if it is machine learning related, it's likely not a good method as far as I know.
@Forexsignalpro
@Forexsignalpro 2 жыл бұрын
@@CodeTradingCafe well I have been back testing my results manually and out of 11 trades 10 went into profit, next day 6/7, following day 5/5 so it has been working quiet well. But I want to automate my method so that the AI trades only according to those specific conditions and nothing else. I have created a bot before but the issue with a bot is theres always a delayed reaction. AI makes more sense since it would be able to anticipate that the signals would confirm ahead of time. I need something with precision.
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
I see what you mean and now I am curious to know why is your strategy that time sensitive I would say seconds sensitive 🙂 usually the delay incurred by bots shouldn't be significant (I would say 1 second max)
@Forexsignalpro
@Forexsignalpro 2 жыл бұрын
@@CodeTradingCafe well I'm not a coder, im only a trader. I used fxdreema to code for me. However as simple as it is to use when I actually try and use it to trade it would miss an entry and only enter afterwards. It can't anticipate the perfect momment to enter. I have a scalping strategy I use. In one day I went from 3 000 to 11k in one day. But it's done pretty manually atm.
@Forexsignalpro
@Forexsignalpro 2 жыл бұрын
@@CodeTradingCafe is it possible for you to email you so that I can send you screenshots?
@shiyas0011
@shiyas0011 2 жыл бұрын
Sir how to run the trading chart on website with the signals?
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
I am not familiar with web development and web related topics, sorry
@shiyas0011
@shiyas0011 2 жыл бұрын
@@CodeTradingCafe ok bro how to make signals in the chart
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@shiyas0011 using pyplot it's possible to add those to the chart, check my previous video on RSI divergence it has markers as signals on the chart
@sefatergbashi
@sefatergbashi 2 жыл бұрын
Thank you!
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Good luck with your strategies
@amolchaugule8294
@amolchaugule8294 2 жыл бұрын
How cheak the relation between index and stock price ??? Can you make video on this topic please .
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Hi thank you, what do you mean by index
@amolchaugule8294
@amolchaugule8294 2 жыл бұрын
@@CodeTradingCafelike Dow jones, Nasdaq, S&P500
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@amolchaugule8294 ah ok so you need to check correlation between let's say SP500 and which stocks?
@amolchaugule8294
@amolchaugule8294 2 жыл бұрын
@@CodeTradingCafe any stock , because i was selected 9 stocks for study
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
@@amolchaugule8294 yes I can do it using statics inference I am not sure if it's useful do you have any preference for stocks?
@reginalditiseng211
@reginalditiseng211 2 жыл бұрын
Nice🥳
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Enjoy it 🙂
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Done link is there
@jamesbond2472
@jamesbond2472 2 жыл бұрын
Please send the code
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Sorry I forgot I will add the link in the description
@CodeTradingCafe
@CodeTradingCafe 2 жыл бұрын
Done link is there
@wesleypaulo1660
@wesleypaulo1660 Жыл бұрын
What about normalizing the attribute values?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
Hey, I did try it in more recent programs it still not worth it, classic break out strategies work better.
@wesleypaulo1660
@wesleypaulo1660 Жыл бұрын
@@CodeTradingCafe i got :3. Thx for answer ^^
@valueray
@valueray Жыл бұрын
coud you please do this in neuralprophet rather than xboost?
@CodeTradingCafe
@CodeTradingCafe Жыл бұрын
definitely yes, this is one priority topic now (it was already on my list). Will try to make it in the coming few weeks. Unless it turns out that it needs more debugging lol
Price Trend Detection Using Machine Learning For Trading
31:07
CodeTrading
Рет қаралды 35 М.
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 23 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 8 МЛН
WORLD BEST MAGIC SECRETS
00:50
MasomkaMagic
Рет қаралды 54 МЛН
100 Identical Twins Fight For $250,000
35:40
MrBeast
Рет қаралды 52 МЛН
Stock Technical Indicators Using Python
24:03
Computer Science
Рет қаралды 27 М.
Rayner Teo Bollinger Bands Strategy Backtest In Python High Return
23:29
Automated Price Break Out Detection: Algorithmic Trading In Python
16:34
Automated RSI Scalping Strategy Tested In Python
33:32
CodeTrading
Рет қаралды 15 М.
Predict The Stock Market With Machine Learning And Python
35:55
Dataquest
Рет қаралды 692 М.
Detecting Price Trends in python - Higher Highs, Higher Lows
24:18
Chad Thackray
Рет қаралды 29 М.
Trading Indicator Analysis: CHOCH Indicator Python Implementation
14:10
Technical Stock Analysis Made Easy in Python
29:47
NeuralNine
Рет қаралды 66 М.
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 23 МЛН