Once again thank you so much for the lesson. Just to make things more complicated what about having a dollar or euro account and trading the Gbp/Jpy. You need to know the exchange rate of Usd/Jpy or Eur/Jpy at the time of the trade to correctly calculate the lot size.
Hey Vassilis, Yes it becomes more complicated but once coded it's automated, the only challenge is to stream USDJPY and additional exchange data live for the algorithm to compute the values.
Thanks for the video. How do you guys optimizing your algos. Are you using fixed lot size or dynamic lot size based? What is best way and why? My question for optimization phase only.
Optimization needs to be run on 3 different approaches of lot sizing, to study all the cases, but equity percentage is also a good compromise to start a quick backtest.
Hello! While watching and testing half your videos out (insanely awesome stuff) i tried doing the pivot and price channel method but had multiple issues with the channel and my daily stock data i opted to use the rsi and ran multiple iterations on which values to best use for my market and it looks promising maybe you can try it out !
Method 1 "fixed"is better then the Method 2. Methos 2 is called "fixed fractional position sizing" but there's a mathematical issue with it since it's geometric mean is lower then your arithmetic mean and the gap is increaing with more trades you do. With every win and loss, you have this degradation due to how the compounding is used.
@@CodeTradingCafe Yes, but if yo use a fixed percentage of the ever changing equity, your position size is changing after every trade, which will make a diffrence between geometric and arithmetic mean.
Hi, next is the function inherited from the backtesting package, it contains the strategy conditions basically and will be applied on each candle in the data.
it depends on the pips precision, for example EUR, GBP, CHD AUS, NZD they can all run using same parameters. But JPY is different, same for stocks, you need to check the pip precision provided in the price.
If I execute the code without leverage and 10000 cash it doesnt make any trades, maybe it is an error on your code, I cant explain it to be true, if I am not wrong, in the original code we have 250 cash with 1/30 leverage, that should be around 7500 buying power, and the code I execute is the same but with 10000 cash, I dont know is the code is to be used without leverage. please, let me know if there is an error
Depending on the asset you are trading and the price required for a trade. Try increasing the amount of cash to 100000, for example to cover trading expenses, let us know if it works.
Man I dont mean to be rude, but the RSI does not work like that. If the RSI is low that means the strenth of the trend is low currently (which is always followed by a high strength trend). The strength of the trend says nothing about the direction. Using the RSI (at least the absolute values) this way will drive you to ruin. What you should instead do is understand what the rsi is mathematically. If the RSI's change rate is negative, the trend is slowing down. If the RSI's change rate is positive, the trend is accelerating. Therefore if you can determine the current trend, and you have the RSI, you can predict the reversal or the consolidation of prices. Therefore the RSIs value being continuously lower than 50 means your position bias shold be to BUY the asset at a point given by the bollinger bands. Not the other way around.
Thank you for sharing, you lost me with contradictory ideas: If the RSI is low that means the strength of the trend is low currently Then ... Therefore the RSIs value being continuously lower than 50 means your position bias should be to BUY. The thing is, there is the classic theory mentioned in books (overbought, oversold, RSI divergence...) then there is years of experience coding strategies... In between the way you use indicators differs a lot.
@@CodeTradingCafe yes the trend is weak means you should be buying. Obviously assuming you have determined the market to be downtrending. Look at the definition of RSI. The formula I mean. If its close to fifty you are flying blind. The equation is useless without the trend information beforehand.
@@CodeTradingCafe yeah but look at the equation. It doesnt make sense to sell below 50, because the potential for upwards movement is much higher if its below 50 than it is for downwards movement. Youd be trading mathematical nonsense if you sold below the 50 line.
So are you telling me if I try to plot the number of times the price goes up after a RSI below 50 and the number of times the price goes down after a RSI above 50 I wouldn't get completely random distribution? since we are discussing mathematical nonsense.
@@CodeTradingCafe No thats exactly what I am saying. If you took the number of times YOU ARE UNAWARE OF THE TREND and bought on every RSI < 50. You would get a perfect distribution. Now if you bought every time the rsi is below 50 UNDER THE AWARENESS OF A DOWNTREND. Youd be in the green slightly more often than you are in the red. But selling as soon as the RSI drops below 50 is a strategy I would call "mean reversion gifting". You are essentially saying you are selling at all the places where the trend has already weakened. But you should consider entry points either exactly on the reversion or when the trend IS STRENGTHENING (not where it has already strengthened).
Never, not technical data anyway. Other types of algorithms given access to financial reports from different companies might be able to predict a crash, at the end it's math...
Your videos are real treasures, excellent information, detailed explanation, smooth flow of education..
Bravo 👏👏
Glad you like them! Thank you for your support!
Liked and subscribed!! Ur an amazing teacher!! Crispy and clear!!
Thanks for your support.
Very helpful information
Thanks
Most welcome
Thanks. very helpful in theory and with application. You're very good bro. best wishes.
So nice of you, thank you for your supportive comment!
Once again thank you so much for the lesson. Just to make things more complicated what about having a dollar or euro account and trading the Gbp/Jpy. You need to know the exchange rate of Usd/Jpy or Eur/Jpy at the time of the trade to correctly calculate the lot size.
Hey Vassilis, Yes it becomes more complicated but once coded it's automated, the only challenge is to stream USDJPY and additional exchange data live for the algorithm to compute the values.
From India...thank you sir for your effort....very valuable video
So nice of you, thank you!
Thanks for the video. How do you guys optimizing your algos. Are you using fixed lot size or dynamic lot size based? What is best way and why? My question for optimization phase only.
Optimization needs to be run on 3 different approaches of lot sizing, to study all the cases, but equity percentage is also a good compromise to start a quick backtest.
fantastic!
Thank you!
Hello! While watching and testing half your videos out (insanely awesome stuff) i tried doing the pivot and price channel method but had multiple issues with the channel and my daily stock data i opted to use the rsi and ran multiple iterations on which values to best use for my market and it looks promising maybe you can try it out !
Thank you for the heads up, will keep the RSI in mind :)
Excellent. How can I update Database?
If you mean the data files you can easily get data from yfinance or dukascopy.
Method 1 "fixed"is better then the Method 2. Methos 2 is called "fixed fractional position sizing" but there's a mathematical issue with it since it's geometric mean is lower then your arithmetic mean and the gap is increaing with more trades you do. With every win and loss, you have this degradation due to how the compounding is used.
I am not sure we're using the mean in this case, it's just a percentage of the total equity.
@@CodeTradingCafe Yes, but if yo use a fixed percentage of the ever changing equity, your position size is changing after every trade, which will make a diffrence between geometric and arithmetic mean.
Yes the size will change depending on your equity, but which mean are you referring to? the mean of the trade size?
Hello,
At 10:21 in the video,
what does "next" mean and what does it do?
def next(self)
super( ). next ( )
Hi, next is the function inherited from the backtesting package, it contains the strategy conditions basically and will be applied on each candle in the data.
funny thing i found out using a list of stocks is each stock needs different parameters.
it depends on the pips precision, for example EUR, GBP, CHD AUS, NZD they can all run using same parameters. But JPY is different, same for stocks, you need to check the pip precision provided in the price.
what changes need to be made to execute the code without leverage?
Just change the margin parameter in the backtest function.
I just have I question is it best with using only one ML or more for best predicting
Hi ML doesn't work well for trading, at least from my experience.
@@CodeTradingCafe Hi then what do you think about rianforecment learning is it better and thank you for your answer
Hi, it requires a lot of data to train and I am not sure the outcome will be as rewarding. We can try it though it only costs time for a test.
Hi how r u Ziad I have a trading system I'm using now manually how can I share it with u on excel so u can test it on python?
Hi, send me an email codingntrading gmail com
Sir! can you please try and make a video about making a solana sniper bot using python??
I could but what do you mean by sniper?
@@CodeTradingCafe sniper means sniping a memecoin before it reaches a certain dex like radium or sniping a meme coin from pump fun sir
Ah OK I understand, it's challenging I think, I haven't worked much on crypto.
@@CodeTradingCafe hope you can make a content about it sir.
If I execute the code without leverage and 10000 cash it doesnt make any trades, maybe it is an error on your code, I cant explain it to be true, if I am not wrong, in the original code we have 250 cash with 1/30 leverage, that should be around 7500 buying power, and the code I execute is the same but with 10000 cash, I dont know is the code is to be used without leverage.
please, let me know if there is an error
Depending on the asset you are trading and the price required for a trade. Try increasing the amount of cash to 100000, for example to cover trading expenses, let us know if it works.
what is the fee per trade, 0.018% gain per trade is easily eaten by fees
Hi, the strategy is just a simple toy to run the different lot sizing approaches, I don't think it's optimized.
hey legend this is hard to learn one most be good at programming so he can master this algo thing
takes a bit of studying consistently for a year or so, very much possible. Good luck!
Man I dont mean to be rude, but the RSI does not work like that. If the RSI is low that means the strenth of the trend is low currently (which is always followed by a high strength trend). The strength of the trend says nothing about the direction. Using the RSI (at least the absolute values) this way will drive you to ruin. What you should instead do is understand what the rsi is mathematically. If the RSI's change rate is negative, the trend is slowing down. If the RSI's change rate is positive, the trend is accelerating. Therefore if you can determine the current trend, and you have the RSI, you can predict the reversal or the consolidation of prices. Therefore the RSIs value being continuously lower than 50 means your position bias shold be to BUY the asset at a point given by the bollinger bands. Not the other way around.
Thank you for sharing, you lost me with contradictory ideas: If the RSI is low that means the strength of the trend is low currently Then ... Therefore the RSIs value being continuously lower than 50 means your position bias should be to BUY.
The thing is, there is the classic theory mentioned in books (overbought, oversold, RSI divergence...) then there is years of experience coding strategies... In between the way you use indicators differs a lot.
@@CodeTradingCafe yes the trend is weak means you should be buying. Obviously assuming you have determined the market to be downtrending.
Look at the definition of RSI. The formula I mean. If its close to fifty you are flying blind. The equation is useless without the trend information beforehand.
@@CodeTradingCafe yeah but look at the equation. It doesnt make sense to sell below 50, because the potential for upwards movement is much higher if its below 50 than it is for downwards movement. Youd be trading mathematical nonsense if you sold below the 50 line.
So are you telling me if I try to plot the number of times the price goes up after a RSI below 50 and the number of times the price goes down after a RSI above 50 I wouldn't get completely random distribution? since we are discussing mathematical nonsense.
@@CodeTradingCafe No thats exactly what I am saying. If you took the number of times YOU ARE UNAWARE OF THE TREND and bought on every RSI < 50. You would get a perfect distribution.
Now if you bought every time the rsi is below 50 UNDER THE AWARENESS OF A DOWNTREND. Youd be in the green slightly more often than you are in the red.
But selling as soon as the RSI drops below 50 is a strategy I would call "mean reversion gifting". You are essentially saying you are selling at all the places where the trend has already weakened.
But you should consider entry points either exactly on the reversion or when the trend IS STRENGTHENING (not where it has already strengthened).
the algorithms can predict market apocalypse ?
Never, not technical data anyway. Other types of algorithms given access to financial reports from different companies might be able to predict a crash, at the end it's math...
@@CodeTradingCafe thank you for your algorithms and your help
Hello how can I contact you
email is in about section