3 Essential Methods for Risk Management & Algorithmic Trading

Поділитися
Вставка
  • Опубліковано 18 лис 2024

КОМЕНТАРІ • 63

  • @talalshamijo
    @talalshamijo Місяць тому

    Your videos are real treasures, excellent information, detailed explanation, smooth flow of education..
    Bravo 👏👏

    • @CodeTradingCafe
      @CodeTradingCafe  Місяць тому

      Glad you like them! Thank you for your support!

  • @AllTimeMoneyyy
    @AllTimeMoneyyy 3 місяці тому +4

    Liked and subscribed!! Ur an amazing teacher!! Crispy and clear!!

  • @sahilkukadkar9620
    @sahilkukadkar9620 3 місяці тому +1

    Very helpful information
    Thanks

  • @marylward360
    @marylward360 3 місяці тому +1

    Thanks. very helpful in theory and with application. You're very good bro. best wishes.

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      So nice of you, thank you for your supportive comment!

  • @vassiliscapsis5828
    @vassiliscapsis5828 3 місяці тому +1

    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.

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      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.

  • @DEEPAKCHAUDHARI-d9g
    @DEEPAKCHAUDHARI-d9g 3 місяці тому +2

    From India...thank you sir for your effort....very valuable video

  • @Robustby
    @Robustby 3 місяці тому +1

    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.

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      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.

  • @weipingxing6173
    @weipingxing6173 3 місяці тому +1

    fantastic!

  • @STSamurai
    @STSamurai 2 місяці тому +1

    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 !

    • @CodeTradingCafe
      @CodeTradingCafe  2 місяці тому +1

      Thank you for the heads up, will keep the RSI in mind :)

  • @aarondelarosa3146
    @aarondelarosa3146 2 місяці тому +1

    Excellent. How can I update Database?

    • @CodeTradingCafe
      @CodeTradingCafe  2 місяці тому

      If you mean the data files you can easily get data from yfinance or dukascopy.

  • @RuDyyx
    @RuDyyx 2 місяці тому +1

    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
      @CodeTradingCafe  2 місяці тому

      I am not sure we're using the mean in this case, it's just a percentage of the total equity.

    • @RuDyyx
      @RuDyyx 2 місяці тому +1

      @@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.

    • @CodeTradingCafe
      @CodeTradingCafe  2 місяці тому

      Yes the size will change depending on your equity, but which mean are you referring to? the mean of the trade size?

  • @adinan1000
    @adinan1000 24 дні тому

    Hello,
    At 10:21 in the video,
    what does "next" mean and what does it do?
    def next(self)
    super( ). next ( )

    • @CodeTradingCafe
      @CodeTradingCafe  22 дні тому +1

      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.

  • @rverm1000
    @rverm1000 3 місяці тому +3

    funny thing i found out using a list of stocks is each stock needs different parameters.

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому +2

      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.

  • @danidelgado7443
    @danidelgado7443 Місяць тому

    what changes need to be made to execute the code without leverage?

    • @CodeTradingCafe
      @CodeTradingCafe  Місяць тому

      Just change the margin parameter in the backtest function.

  • @tahernajisawas1665
    @tahernajisawas1665 3 місяці тому +1

    I just have I question is it best with using only one ML or more for best predicting

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      Hi ML doesn't work well for trading, at least from my experience.

    • @tahernajisawas1665
      @tahernajisawas1665 3 місяці тому +1

      @@CodeTradingCafe Hi then what do you think about rianforecment learning is it better and thank you for your answer

    • @CodeTradingCafe
      @CodeTradingCafe  2 місяці тому

      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.

  • @beroskaf9198
    @beroskaf9198 3 місяці тому +1

    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?

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      Hi, send me an email codingntrading gmail com

  • @TenSaikyo
    @TenSaikyo 3 місяці тому +1

    Sir! can you please try and make a video about making a solana sniper bot using python??

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      I could but what do you mean by sniper?

    • @TenSaikyo
      @TenSaikyo 3 місяці тому +1

      @@CodeTradingCafe sniper means sniping a memecoin before it reaches a certain dex like radium or sniping a meme coin from pump fun sir

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      Ah OK I understand, it's challenging I think, I haven't worked much on crypto.

    • @TenSaikyo
      @TenSaikyo 3 місяці тому

      @@CodeTradingCafe hope you can make a content about it sir.

  • @danidelgado7443
    @danidelgado7443 Місяць тому

    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

    • @CodeTradingCafe
      @CodeTradingCafe  Місяць тому

      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.

  • @popescugeorgebogdan5766
    @popescugeorgebogdan5766 2 місяці тому +1

    what is the fee per trade, 0.018% gain per trade is easily eaten by fees

    • @CodeTradingCafe
      @CodeTradingCafe  2 місяці тому

      Hi, the strategy is just a simple toy to run the different lot sizing approaches, I don't think it's optimized.

  • @ahmedbadal3795
    @ahmedbadal3795 2 місяці тому

    hey legend this is hard to learn one most be good at programming so he can master this algo thing

    • @CodeTradingCafe
      @CodeTradingCafe  2 місяці тому

      takes a bit of studying consistently for a year or so, very much possible. Good luck!

  • @baronhelmut2701
    @baronhelmut2701 3 місяці тому +2

    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.

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому +1

      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.

    • @baronhelmut2701
      @baronhelmut2701 3 місяці тому

      @@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.

    • @baronhelmut2701
      @baronhelmut2701 3 місяці тому

      @@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.

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому

      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.

    • @baronhelmut2701
      @baronhelmut2701 3 місяці тому

      @@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).

  • @fredyhazard6412
    @fredyhazard6412 3 місяці тому +1

    the algorithms can predict market apocalypse ?

    • @CodeTradingCafe
      @CodeTradingCafe  3 місяці тому +1

      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...

    • @fredyhazard6412
      @fredyhazard6412 3 місяці тому +1

      @@CodeTradingCafe thank you for your algorithms and your help

  • @karabomuzamane3430
    @karabomuzamane3430 3 місяці тому +1

    Hello how can I contact you