Python Backtest: Profitable Scalping Strategy with VWAP, Bollinger Bands and RSI Indicators

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ต.ค. 2022
  • This video shows a profitable scalping strategy fully backtested in python, this strategy uses the VWAP, Bollinger Bands and the RSI indicators for confirmation. The backtest shows profitable returns over 3 years of data with increasing equity. The algorithm was built in python and can be improved changing some of the parameters. Algorithmic scalping can be fit into an automated trading bot for automated profitability. Good luck, I hope you will enjoy this one!
    💲 Discount Coupon for My Udemy course on Algorithmic Trading:
    bit.ly/CouponAlgorithmicTrading
    The python code download link:
    drive.google.com/file/d/1G76v...
    the data file:
    drive.google.com/file/d/1-QOb...

ความคิดเห็น • 464

  • @arrabitbot
    @arrabitbot 5 หลายเดือนก่อน +31

    I appreciate a lot your content. The snippet that evaluate uptrend or downtrend is very slow, I've refactorized it removing loops and now is very fast. I share my update. Thanks for your effort and strategies. Alex.
    df['Max_Open_Close'] = np.maximum(df['Open'], df['Close'])
    df['Min_Open_Close'] = np.minimum(df['Open'], df['Close'])
    df['upt'] = 1
    df['dnt'] = 1
    df.loc[(df['Max_Open_Close'] >= df['VWAP']), 'dnt'] = 0
    df.loc[(df['Min_Open_Close']

    • @CodeTradingCafe
      @CodeTradingCafe  5 หลายเดือนก่อน +4

      Thanks a lot for your input, the code looks nice, I will pin your comment for other viewers in case they need the improved version.

    • @kisumang7971
      @kisumang7971 3 หลายเดือนก่อน +1

      hi im newbie for python. would you help me where input this code? thanks much!

    • @tamaspete8299
      @tamaspete8299 หลายเดือนก่อน +1

      can you help for me how i can replace these code? I think I place the wrong place and it crashed

  • @davidhuber563
    @davidhuber563 10 หลายเดือนก่อน +2

    Thank you for this video ! I began algo trading 1 year ago and your video helped me a lot. Seeing a scalping video on your Chanel is very cool, because there are no big ressources on scalping strategies that are reliable on TH-cam and the internet in my opinion, so thank you !

    • @CodeTradingCafe
      @CodeTradingCafe  10 หลายเดือนก่อน +2

      Hi, thank you for your comment. Indeed I didn't want to make scalping video at first because it's challenging the data has too much noise, but this was requested so many times, and I think the VWAP is really good and also the BBands help define a good entry point. Good luck to you! (actually it has been a while I haven't looked into lower timeframes maybe I will revisit scalping soon).

  • @rupindersingh1312
    @rupindersingh1312 ปีที่แล้ว +9

    i have no words how to express my gratitude for this channel . Really your every video is making a change in my journey of algo trading .

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Thank you for your supportive comment, it's nice to know and very encouraging! Good luck!

  • @horexas
    @horexas ปีที่แล้ว +7

    Great content! Perfectly synchronised with my current experiment

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Happy you liked it, I like the vwap recently it's a nice indicator

  • @kro8732
    @kro8732 ปีที่แล้ว +18

    Hey! You can optimize parameters with methods like differential evolution. I'm not sure if that will do better but you can give it a try. Great video as always.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +4

      Thank you for your support! You're right it is worth trying an optimization see what it gives, I am not sure how much improvement there will be.

  • @lennard4454
    @lennard4454 ปีที่แล้ว +48

    I was able to archive 3000% in return with this algorithm and some improvements in the parameters for Bitcoin 5m chart data, backtested from Jan 2022 until today.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +9

      Thank you for your feedback, just be careful with the drawdown keep it on your radar.

    • @troygomez4089
      @troygomez4089 ปีที่แล้ว +3

      👌 Did you add technical indicators or just adjust the values for the given tis?

    • @lennard4454
      @lennard4454 ปีที่แล้ว +28

      ​@@troygomez4089 just adjusted the parameters:
      rsi length: 16
      bbands length: 15
      bbands std: 2.0
      back_candles: 26
      total signal buy below rsi: 46
      total signal sell above rsi: 59
      atr index: 7
      slatr: 1.2
      tpsl_ratio: 1.89
      close long above/equal rsi: 90
      close short below/equal rsi: 10

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +8

      Thank you for sharing

    • @lennard4454
      @lennard4454 ปีที่แล้ว +5

      @@troygomez4089 also had a typo ... used BBL instead of BBU to confirm the total sell signal... but correcting it decreased the success in return and win rate ... I guess the other parameters would have to be optimized again - although still 1300% return

  • @warwick3805
    @warwick3805 5 หลายเดือนก่อน +1

    Great video mate, thanks.
    I am not a coder, but I try, with what I have learnt, to get an Algo that works. I am now a follower and look forward to learning more.

    • @CodeTradingCafe
      @CodeTradingCafe  5 หลายเดือนก่อน

      Probably one of the most rewarding/satisfying comments! Glad I could help! Good luck!

  • @tmyersf4
    @tmyersf4 ปีที่แล้ว +1

    Was watching some of your videos today on detecting triangle and channel patterns so nice to see videos on this topics. Maybe you could also do a future video on harmonic pattern detection.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your comment, harmonics are not reliable, just my opinion (and my experience) but I might be wrong.

  • @maciekpaciarski9343
    @maciekpaciarski9343 ปีที่แล้ว +3

    Great work. Please continue

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your support and encouragement 🙂

  • @joaosobral1354
    @joaosobral1354 ปีที่แล้ว +1

    Amazing video. Keep up the good work

  • @fernandomilans1296
    @fernandomilans1296 ปีที่แล้ว +5

    at minute 10:37,
    To verify that entry below the VWAP, perhaps you could calculate the difference between the VWAP and the Bollinger line, and from there if it passes a percentage it is taken as valid.
    And maybe a bit more complicated to verify the sail in major or minor frames, and see a confirmation there...
    Or adding more indicators like the MACD, EMA, or volume.
    In addition, support or resistance could be taken into account (later video), or Wickokff accumulation zones, distribution zones, doing nothing at market openings (a lot of volatility), perhaps it could improve performance

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +2

      Support and resistance levels are crucial, I agree and the trading time wasn't included yet so trades are opened anytime the market is opened this can be improved definitely.

    • @gawags4709
      @gawags4709 7 หลายเดือนก่อน

      ​@@CodeTradingCafe I use volume data to confirm signal above or below vwap. I want to see heavy buying or selling volume moving the price action in relation to time. I use at least 2 or 3 time scales on the chart such as (1, 5, 10, 15, daily). I only focus on trading 1 stock/product at a time and get to know how it moves and try to understand the time frames that larger investors make their trades. It's always interesting to see how light volume moves the price after these heavier volume periods. Everything you discussed in this video is pretty similar to the strategy I use to scalp with.

  • @khaleelgaffar3436
    @khaleelgaffar3436 ปีที่แล้ว +1

    Lovely video as usual!

  • @user-fe2oh8oj2u
    @user-fe2oh8oj2u ปีที่แล้ว +18

    Great content as usual. Definitely expand more on the strategy. Question: have you integrated your Python code with some trading platform? I mean, the code shows whether to buy or sell, but how the actual act of buying/selling is happening? Is it automated and Python does it for you or you do it manually based on the results of your code?

    • @user-fe2oh8oj2u
      @user-fe2oh8oj2u ปีที่แล้ว +2

      @@thinketh2408, I see. So, first and foremost, the trading platform I am using should be allowing (providing api). Only then I can automate the process via building/using a trading bot.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +4

      Yes it depends on the platform they usually provide a python interface that you can add to your program and automate the trading process, I have an old video on this using oanda s API.

    • @user-fe2oh8oj2u
      @user-fe2oh8oj2u ปีที่แล้ว +1

      @@CodeTradingCafe , thx for the reply. I will definitely check it out!

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      @@dxtrmst1618 I think it is being rejected when spread is high

    • @jaykishan3299
      @jaykishan3299 ปีที่แล้ว

      @@CodeTradingCafe suggest

  • @JohnQuezadaHuayamave
    @JohnQuezadaHuayamave ปีที่แล้ว +1

    Your videos are incredible, I'm going to review them all, I'm new, I just saw the first video today, sorry if I don't write very well, it's that I speak Spanish and English is not precisely my strong language and you could use a weighted moving average of 150 and 300 to see trends.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hey, thank you for your comment, I will try weighted moving average see how it goes. Good luck!

  • @sadootaqoo981
    @sadootaqoo981 ปีที่แล้ว +5

    Before testing other parameters, try m1 candles to m30 and see which one yields the most win rate, very good content btw , cant wait for an update

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +2

      Thank you, yes I was thinking m15 might be a good candidate... There only one way to find out

  • @sw-ln1hh
    @sw-ln1hh ปีที่แล้ว +1

    very awesome thank you for your coin test

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hey, thank you for your constant support, glad the vid is helpful

  • @Maximus18.6
    @Maximus18.6 4 หลายเดือนก่อน +4

    First of all let me congratulate you for such amasing explanation and presentation. You explain very complex concepts of financial indicators and programming in only 15 minutes, that is spectacular. It will be very interesting to add some market sentiment analysis using Python to find news that impact stock price.

    • @CodeTradingCafe
      @CodeTradingCafe  4 หลายเดือนก่อน +2

      Thank you for your supportive comment. Sentiment analysis is on my list at least to show how it can be implemented, the only challenge is that you never know when the sentiment will be reflected on the market in a day, a week or more, but I think this is something we can discuss when I make the video. Have great new year!

  • @jaseemali7634
    @jaseemali7634 ปีที่แล้ว +1

    Thanks for the video, Great Content. Waiting for your complete automated trading course including live trading in udemy !!!.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your support ! Glad you enjoy the learning process.

  • @Pythonology
    @Pythonology 8 หลายเดือนก่อน +1

    great! love your videos so far! how do you use this to run on the current market and make trades?

    • @CodeTradingCafe
      @CodeTradingCafe  8 หลายเดือนก่อน

      Thank you, to use a strategy live we can link it to a broker API, check this one: th-cam.com/video/WcfKaZL4vpA/w-d-xo.html

  • @rahuldavar7209
    @rahuldavar7209 ปีที่แล้ว +1

    Thank you so much!

  • @epiktrader2656
    @epiktrader2656 ปีที่แล้ว +6

    This is very good. Please bring more scalping and intrday strategy backtest. Can you please add a initial capital, so that we can see how much a particular amount will grow.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +2

      Thank you for your comment, don't forget that fees were not included here so initial capital might not be very accurate

    • @epiktrader2656
      @epiktrader2656 ปีที่แล้ว +3

      @@CodeTradingCafe Thanks for replying. Will you consider making more videos on intraday and scalping strategy

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +3

      I will try but lower timeframes are more challenging for coding it's much easier on daily timeframes, but yes I will keep this ongoing see if we can sort a nice strategy

  • @rainnerl
    @rainnerl ปีที่แล้ว +1

    hi, first i want to thank you for your content is extremely educative... looking forward for a simple TrendLine Breakout Detection or TrendLine Touch Bounce....

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your support, your idea is something on my list I always vouch for a simple approach. Good luck!

  • @tdrmahdi
    @tdrmahdi ปีที่แล้ว +1

    great work boss,, keep them coming

  • @santhoshdasari7
    @santhoshdasari7 ปีที่แล้ว +1

    Thanks a lot for sharing

  • @mike5iiii
    @mike5iiii 3 หลายเดือนก่อน

    nice job, I learned so much from you. Thanks

    • @CodeTradingCafe
      @CodeTradingCafe  3 หลายเดือนก่อน

      Thanks for watching! and for your support!

  • @mouradelcadi
    @mouradelcadi ปีที่แล้ว +1

    I'm completely newbie 😌 thanks so much

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you and good luck with your coding!

  • @rezasadeghi2520
    @rezasadeghi2520 ปีที่แล้ว +1

    Thank you so much.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your support, good luck!

  • @eliotharreau7627
    @eliotharreau7627 ปีที่แล้ว

    Very nice code. This can help a lot. Thnx bro.

    • @eliotharreau7627
      @eliotharreau7627 ปีที่แล้ว

      You can see this videos, a very elegant way to use the BB. 👌👌 th-cam.com/video/PcVHTx5HYwc/w-d-xo.html

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your support and encouragement, good luck!

  • @MelarDev
    @MelarDev ปีที่แล้ว +2

    One suggestion for a future video, Detect Fair Value Gaps and implement a strategy (ICT) based on it.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hi thank you, I will look into this for the coming year.

  • @user-dl3wm6tt7e
    @user-dl3wm6tt7e 9 หลายเดือนก่อน +1

    Hi, great video, I did not know that backtesting, it is quite intuitive and easy to interpret.
    With CFDs or forex, how would you do the backtesting? because you have ask and bid data, in addition to the spread which is dynamic?
    And this backtesting would support hedging? i.e. if for example I open the position, and 90% of the way I want to move the stop loss to cover profits, that could be done?

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน

      Great that you liked these videos. Yes the spread can be included as 2/1000 commission (depending on broker and asset) it's not very dynamic but the approximation is ok. And yes you can apply hedging using backtesting I did it in one of my recent videos on trading the grid system where we buy and sell 2 positions at the same time.

  • @MrDanZig
    @MrDanZig 9 หลายเดือนก่อน +1

    Wow man! This is gold! How far is this from a trading bot that implements this strategy?

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน

      Hi, thank you, I haven't tested the robustness of this strategy yet, I must say it's easy to get lost in the numerous ways one can trade and always trying to choose the best.

  • @sadikelouahabi398
    @sadikelouahabi398 ปีที่แล้ว +1

    thank you very much for your fantastic work for free for your subscribers.
    If you can add the divergence I think the winning ratio will increase a lot.
    thank you

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi thank you for your support, which divergence?

    • @sadikelouahabi398
      @sadikelouahabi398 ปีที่แล้ว +1

      RSI regular divergences.
      Thank you so much.

  • @rezafeizabadi-vf1xt
    @rezafeizabadi-vf1xt หลายเดือนก่อน

    Thank you for very good video. To identify the type of trend, the following condition can be replaced, if the price is higher than ATR in 80% of the past candlesticks, for example, it can be concluded that the price is bullish.

    • @CodeTradingCafe
      @CodeTradingCafe  หลายเดือนก่อน

      Hi, thank you for sharing, but the ATR is always below the price value, it's just the range, can you be more specific?

  • @lautaa33
    @lautaa33 ปีที่แล้ว +6

    Great content! Btw you can do the "VWAP Signal" calculation vectorized instead of iteratively so that it takes less than a second instead of the few minutes that takes in your code:
    downtrend = df[["Open", "Close"]].rolling(backcandles).max().max(axis=1) < df.VWAP, # if the highest candle body is below vwap then all candles in the rolling window are below vwap
    uptrend = df[["Open", "Close"]].rolling(backcandles).min().min(axis=1) > df.VWAP # if the lowest candle body is above vwap then all candles in the rolling window are above vwap

    • @lautaa33
      @lautaa33 ปีที่แล้ว +1

      actually my code would only look at 1 vwap value for each window, but surely there is another way to do it right

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi thank you for sharing this, actually yes we can vectorize most of the computed values. But just for the sake of this discussion, sometimes if you are streaming for a live trading bot it's easier to have a function to call for each candle (can't explain clearly in the comment only in some particular cases of live trading it works better this way, but definitely slower).

    • @lautaa33
      @lautaa33 ปีที่แล้ว +1

      ​ @CodeTrading Ah yeah I understand, you get a live feed candle by candle, and you want to pass to a function only the last n candles to calculate just the very latest vwap signal.
      Anyways, for anyone that wants the vectorized form for doing parameter optimization, I finally came up with the solution:
      downtrend_mask = df[["Open", "Close"]].max(axis=1).lt(df["VWAP"]).rolling(backcandles+1).sum().eq(backcandles+1)
      uptrend_mask = df[["Open", "Close"]].min(axis=1).gt(df["VWAP"]).rolling(backcandles+1).sum().eq(backcandles+1)
      df['VWAPSignal'] = 0
      df.loc[downtrend_mask, "VWAPSignal"] = 1
      df.loc[uptrend_mask, "VWAPSignal"] = 2
      ---
      The +1 after backcandles is to count the current row AND n backcandles (same effect as what is done in the iterative version done in the video/jupyter)

    • @lautaa33
      @lautaa33 ปีที่แล้ว +2

      @@CodeTradingCafe Today I learned that you can just add the decorator @njit from the numba library to your function and will probably run faster than my complicated vectorized stuff. Might need to pass the pandas columns as numpy arrays but @njit takes the iterative loop, does just-in-time compilation of it and efficiently executes it, and can do it in a vectorized way

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      @@lautaa33 Hey thanks, I didn't know this, have to check it out!

  • @taraspanamarev6281
    @taraspanamarev6281 ปีที่แล้ว +1

    Thanks for the video! The strategy is interesting but very unstable. I mean it is very sensitive to changes in parameters

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Yes robustness must be tested as well to find the best parameters set, it's a start base as it seems. Usually scalping strategies are hard to tune I was happy with this one.

  • @robinprashantha1
    @robinprashantha1 ปีที่แล้ว +1

    Thanks for helping me to learn the backtesting strategies. I just want to know how to use bactesting optimize function(bt.optimize) for this custom startegy. So that we can get better results. Your help is much appreciated. Thanks

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, thank you for your comment, I agree the optimize function is important to show I will have to make a video about it soon.

    • @robinprashantha1
      @robinprashantha1 ปีที่แล้ว +1

      Thanks for the help. Waiting for the same

  • @hanspetterfasteng3726
    @hanspetterfasteng3726 ปีที่แล้ว +3

    Yes, can it be testede for a longer time than 3 years? Let's say 10? 🙂 I like all your videos and the format. Do not expectet to trade - but the codex is very interesting. Can you consider adding a video about ruining Python code on a demo accout from a broker? Stocks/forex?

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +2

      Hi thank you, at some point yes I will make a demo trading live but I am still tuning strategies...

  • @anshmiester78900
    @anshmiester78900 ปีที่แล้ว +2

    Hi I really liked your videos. I wanted to know how can we determine which option to buy at which strike price after getting a positive signal. Please do make a video on that too

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for your support, I usually only buy what the signal indicates, I don't know if this answers your question

  • @wizdeasis9846
    @wizdeasis9846 9 หลายเดือนก่อน +1

    I just found out about your channel sir and I really appreciate it. Just a question for non-programmers who want to start programming EAs, is python easier than learning MQL programming? What can you suggest for a non-programmer who wants to learn coding a strategy. Thank you in advance sir! New subscriber here and looking forward to your answer. More power Sir!

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน +1

      Hi, thank you for your comment, both Python and MQL need algorithmic skills, I personally prefer Python it gives more control and you can use it in different fields.

    • @wizdeasis9846
      @wizdeasis9846 9 หลายเดือนก่อน

      @@CodeTradingCafe Thank you sir for the feedback. Can python create MT5 EAs too so it's easy to attach in MT5 platform? Is it possible or what is the workaround for that?

    • @jithendras1535
      @jithendras1535 5 หลายเดือนก่อน

      yes@@wizdeasis9846

    • @wolacc
      @wolacc 2 หลายเดือนก่อน

      ​@@wizdeasis9846you can use python to connect to mt5

  • @adonisdeleon7729
    @adonisdeleon7729 ปีที่แล้ว +1

    this is very awsome but icant find the vwap on trading view thanks for sharing this you made me some profits bro

  • @sz8558
    @sz8558 9 หลายเดือนก่อน +1

    Excellent video and thx for the code. Be great to see you test on say 80% of the sample data and then run it without adjustment on the remaining 20% to simulate real time trading.

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน

      Thank you for your support, you are right ideally we can fit on 2 month and trade one week for example, then slide our fitting window for a new trading period, I will include this in one of my future videos.

  • @Yoncir
    @Yoncir ปีที่แล้ว +1

    Good morning, greetings from Venezuela. I'm starting to watch your videos and they are phenomenal... what does this code work with thanks for the support

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hi thank you for your comment, this is python notebooks so you need jupyter notebook installed, try installing anaconda (see my very first video of this channel)

    • @Yoncir
      @Yoncir ปีที่แล้ว +1

      @@CodeTradingCafe great bro, you just gained a subscriber and python student. where I enter the broker's data to do the tests, thank you very much. Greetings from Venezuela

  • @freepluralism6652
    @freepluralism6652 ปีที่แล้ว +1

    simple but decent strategy. getting => 22% Net Profit / 70% Profitable / 4% Drawdown on BTC/USD 5min TF. I'm using SL x2 and TP x1.5 and a cross above of the lowerband for a long position and vice versa

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Thank you for sharing, it's nice to know how it works on different assets. Good luck!

    • @vpx_mbyt7663
      @vpx_mbyt7663 9 หลายเดือนก่อน

      Hello, may I kindly speak to you

  • @jrm0695
    @jrm0695 10 หลายเดือนก่อน +2

    Great content thank you ! Could you please provide where do you get the data ? It find it hard to find data at this timeframe

    • @CodeTradingCafe
      @CodeTradingCafe  10 หลายเดือนก่อน

      Hi, thank you for your support, my data is rom yfinance or dukascopy (free data), you can also download from your broker. I will make a video maybe this week showing how to download data, I am getting this question a lot, so probably worth it :)

  • @eminsh
    @eminsh ปีที่แล้ว +1

    Your channel is awesome and has got me into trading strategies with Python. I tried using this code on crypto eth-usd but at the vwap signal and total signal I get 0 for the count. Hopefully this makes sense, but any idea why this might be happening? Everything else looks good up to that point. Thanks if you see this and keep the videos coming.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hey, thank you for your nice comment. Which timeframe are you using? The vwap only works on short frames 5min or 15 min are good.

    • @eminsh
      @eminsh ปีที่แล้ว +1

      @@CodeTradingCafe I am using a 5 min timeframe, but I realize now I was only using a day's worth of data.

    • @bretgratt9568
      @bretgratt9568 11 หลายเดือนก่อน

      @eminshall did you find a solution to this problem. I am stuck at the same and I can’t use this strategy in a live account as a result.
      @CodeTrading are you able to share any insights on this issue? Thanks so much for taking your time to share these ideas in a very clear and concise manner.

    • @vpx_mbyt7663
      @vpx_mbyt7663 9 หลายเดือนก่อน

      @@bretgratt9568 hey, how is it going??

  • @leocycling
    @leocycling ปีที่แล้ว +3

    thx bro for this great video as usual, can i understand more the purpose of close trades when RSI >= 90 or RSI < =10.
    if len(self.trades)>0:
    if self.trades[-1].is_long and self.data.RSI[-1]>=90:
    self.trades[-1].close()
    elif self.trades[-1].is_short and self.data.RSI[-1]

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, yes we close the trade if the rsi goes above 90 for long positions and below 10 for short positions, since the rsi will show the overbought and oversold ranges of an asset.

  • @sararhymestvhindi5481
    @sararhymestvhindi5481 ปีที่แล้ว +1

    Thank you so much for providing the wonderful strategy could you please confirm is it going to work on options trading in any instrument in Indian market

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi thank you for your support, there is only one way to find out ... Backtesting, and it might need some parameters tuning depending on the traded asset. Good luck!

  • @icometofightrocky
    @icometofightrocky 3 หลายเดือนก่อน

    Another good video to give me some new trading ideas ! Instead of using the VWAP maybe you can use the 200 EMA to confirm buying above or selling below, if the price breaks the lower Bollinger Band ?

    • @CodeTradingCafe
      @CodeTradingCafe  3 หลายเดือนก่อน

      Hi, we used the moving average in other videos, this one was for vwap and it wasn't as bad.

  • @bayroncabrera7566
    @bayroncabrera7566 6 หลายเดือนก่อน +1

    This is an interesting video and strategy approach. It would be nice to know if you took the transaction fees into account. I've found it very challenging to create profitable strategies in scalping due to trading costs eating up the profits. In this case, I believe you need to use leverage, which is quite risky. Thanks for the video.

    • @CodeTradingCafe
      @CodeTradingCafe  5 หลายเดือนก่อน +1

      Thank you for your support, yes you are absolutely right regarding the fees, and becomes more challenging for lower timeframes, it's somehow easier on daily and 4h timeframes.

    • @majkel1381
      @majkel1381 5 หลายเดือนก่อน +1

      I mean, there were 2076 trades with 197 dollars of income (197%) so You can calculate that for every trade there was about 9 cents made - commision parameter is set to 0, so I think that no broker has less than 9 cents fee per transaction, so the strategy is tragicaly bad, but video and explanation is good keep it up

    • @AwakeningSpirit_
      @AwakeningSpirit_ 4 หลายเดือนก่อน

      some brokers dont charge any fee for trades@@majkel1381

  • @yk-il6dn
    @yk-il6dn ปีที่แล้ว

    Great video, was wondering how you were able to extract history data for ~3 years

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hey thank you, different ways you can use yfinance or dukascopy among others...

    • @yk-il6dn
      @yk-il6dn ปีที่แล้ว

      @@CodeTradingCafe Thanks for the quick response!

    • @rubenghidanac
      @rubenghidanac ปีที่แล้ว +1

      @@CodeTradingCafe yfinance let you download 5-min timeframe?
      Very nice strategy by the way, it will be interesting a video with a platform like mt5 and his api implementation!
      I wish you all the best!!!!!!!!

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      @@rubenghidanac Hi, thank you for your support. Yes with yfinance we can download 5 min timeframe but I think only 3 months at a time, so we can put it in a loop and concatenate the 3 months data, didn't try it but it should work.

  • @dmitriys4279
    @dmitriys4279 หลายเดือนก่อน +1

    thank you bro

    • @CodeTradingCafe
      @CodeTradingCafe  หลายเดือนก่อน

      You're welcome! Thank you for your support.

  • @leandrogoethals6599
    @leandrogoethals6599 9 หลายเดือนก่อน +1

    Can u make a video how the execute trades with python via MT4/MT5 ?

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน

      Hi, thank you for sharing this, it has been proposed before, I think it's a good idea to link Python and MT4/5 I will add it to my list.

  • @ricardospinoza4063
    @ricardospinoza4063 11 หลายเดือนก่อน +1

    Great content!!! I have question. The strategy apply crypto market?

    • @CodeTradingCafe
      @CodeTradingCafe  11 หลายเดือนก่อน

      Thank you for your support! yes it works on any chart because it purely technical, but the results might be different, and you definitely have to tweak the parameters.

  • @mohammedalmontaser1578
    @mohammedalmontaser1578 10 หลายเดือนก่อน +1

    Thanks for your nice content 👍... can you please tell me which is the best scalping strategy in your opinion and you are personally using ... this will be very appreciated

    • @CodeTradingCafe
      @CodeTradingCafe  10 หลายเดือนก่อน

      My favorite is using VWAP and wait for the price to bounce on after completed retracement, 5min or 15 min timeframe (I prefer 5 min) but in general I avoid scalping it's tiring for me, I start making mistakes after 1 hour of scalping.

    • @vpx_mbyt7663
      @vpx_mbyt7663 9 หลายเดือนก่อน

      @@CodeTradingCafe but arent u using this trading bot??

  • @zeerar
    @zeerar 6 หลายเดือนก่อน +2

    Thanks

    • @CodeTradingCafe
      @CodeTradingCafe  6 หลายเดือนก่อน +1

      Thank you for your support!

  • @abdulazizshomurodov
    @abdulazizshomurodov ปีที่แล้ว +1

    WoW🤩

  • @aliyananwar3727
    @aliyananwar3727 ปีที่แล้ว +1

    I am working on Exponential Moving Average indicators backtesting with 8 period 13 period and 21 period. 8 period crossover with 21 period and their spread will indicate whether the trend is strong or not.

  • @thinketh2408
    @thinketh2408 ปีที่แล้ว +2

    Wow thanks...

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Thank you, glad you liked it!

    • @thinketh2408
      @thinketh2408 ปีที่แล้ว +1

      @@CodeTradingCafe It's a treasure ❤️.

  • @jflebas1217
    @jflebas1217 ปีที่แล้ว +2

    Could be interesting to try higher tf (Like h1) but smaller periods like 2-3 BBperiod

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Yes it can be tuned this way but vwap is not applicable for higher timeframes so maybe we switch to different indicator.

  • @sajjadnaghshineh4224
    @sajjadnaghshineh4224 4 หลายเดือนก่อน +1

    Hi, thanks a lot for sharing this profitable strategy and I have a question about Max Drawdown Duration, it is 280 days right? I think it is actually 280 canldes which means in 5M time frame it is about one day , and because the default of backtesting module is 1Day time frame it calculate each candle as a day. Am I think correctly or not?

    • @CodeTradingCafe
      @CodeTradingCafe  4 หลายเดือนก่อน

      Hi, actually it is in days, and yes it's a lot but the test was on 3 years I think. So the system might work for a year then stop working for a while or so.

  • @user-qw6nw4mu7m
    @user-qw6nw4mu7m ปีที่แล้ว +1

    Great video... I'll test it.... There is one question: Can I somehow learn more about signal sorting ??

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi thank you for your comment, I am not sure I understand what you mean by signal sorting.

    • @user-qw6nw4mu7m
      @user-qw6nw4mu7m ปีที่แล้ว +1

      @@CodeTradingCafe I reviewed the video carefully... The question is removed... I was a little mistaken..

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Glad you worked it out, good luck!

  • @robertcayman1105
    @robertcayman1105 9 วันที่ผ่านมา +1

    please make a video with the standard deviation + vwap as a strategy !

    • @CodeTradingCafe
      @CodeTradingCafe  7 วันที่ผ่านมา +1

      it's on my list, but it might take me a while to reach it...

  • @christolabuschagne4382
    @christolabuschagne4382 ปีที่แล้ว +1

    Trying to play around with the project. Very well done. I can't seem to figure out how to correctly compinsate for a commission of something like 0.5%. You would need to add it to the backtest init as 0.005, but then the buy and sell sl and tp values does not calculate correctly. Can anyone please point me into the right direction? Or is it just that the fees would kill you quick?

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, I have to recheck how backtesting library is calculating the commission fees when we use for example 0.005 (the parameter in the backtesting function we are using), so far I didn't include the fees because I wanted to show indicators effects and compare among different indicators combinations.

  • @norimanghazi2782
    @norimanghazi2782 ปีที่แล้ว +1

    Hi,
    Is there a possible to consider commission's fee for Trading bot? For example 2% or 0.1% because some of the Broker's have Commission's fee and It's very important to consider this fee.
    It's a great concept.
    I would like to see in future how to connect this bot to Broker's platform with API.
    Thanks,

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Sure it's possible to add fees, backtesting library can do this but I don't know how it's counting fees in the background, or we can do it manually as well. Connection with the broker... I have to make a new video about it, in the meantime check this one th-cam.com/video/e1Ut4Iap10M/w-d-xo.html

  • @vpx_mbyt7663
    @vpx_mbyt7663 8 หลายเดือนก่อน +2

    Hi, the VWAP made in python, doesn't work like the one on tradingview. Can someone assist me please 😢

    • @CodeTradingCafe
      @CodeTradingCafe  8 หลายเดือนก่อน

      It might a variation, you can code your own as well if you need a specific VWAP. I hope this helps.

  • @user-ji4dx4we4e
    @user-ji4dx4we4e ปีที่แล้ว +1

    excellent work, where did you get the data?

    • @CodeTradingCafe
      @CodeTradingCafe  11 หลายเดือนก่อน +1

      Hi thank you, yfinance or dukascopy both provide data.

  • @AI_BotBuilder
    @AI_BotBuilder ปีที่แล้ว

    I love your channel so much, but I have to be honest, when deploying live, it’s best to drop strategies that are below Sharpe ratio of 2, just my personal experience

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hi, thank you for the heads up, you are probably right, I think looking at the recent comments, I will build a deployment function where we can easily test these strategies live, it's ok for low timeframes much slower for daily timeframe (which is my favorite for algos but too slow to test live).

  • @carmast3r
    @carmast3r ปีที่แล้ว +1

    Hey, where do you get your raw data from? (Yahoo Finance doesn't seem to have all the headers your code requires)

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, Dukascopy is a good source, also any broker with a demo account can have access to historical data.

  • @acksonmutoba3420
    @acksonmutoba3420 4 หลายเดือนก่อน

    I read your response that the annual profitability of some of these strategies varies by 8-14%. You mentioned again a concept of instead deploying the algorithm but using it for entry signals which calls for more work. Do you imply the profit percent will be higher if we use these algorithms for entry signals only? if so what would be the approximate return percent if we use these algorithms for signals?

    • @CodeTradingCafe
      @CodeTradingCafe  4 หลายเดือนก่อน

      Hi, yes if you use these algorithms just for signaling, but then you as a human trader validate or reject the entry signal, plus you manage the trade manually you will get better results (around 25% annual, only my estimation other traders might be better and provide 50% or more... not me). So basically the algorithms are only here to do the waiting on your behalf and when the pattern is detected it becomes your job to trade.

  • @user-qw6nw4mu7m
    @user-qw6nw4mu7m ปีที่แล้ว +2

    Hello. I found something, but not the easy way. Try this as an entry point. use in strips length 20 and std 2.5 . This will show both the highs and lows that can be support and resistance at 0 and 1.
    data['HZ'] = (data['close'] - data['BBL_20_2.5'])/(data['BBU_20_2.5'] - data['BBL_20_2.5'])

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +2

      I like it and it's easier then another method I published here for support and resistance. Thank you

    • @user-qw6nw4mu7m
      @user-qw6nw4mu7m ปีที่แล้ว +1

      @@CodeTradingCafe
      Thank you, too. I will be waiting for your next video.

  • @lance3401
    @lance3401 11 หลายเดือนก่อน +1

    If would be good if you add pendind stop and limit positions, but for accounts > $1000, and to close positions just with % can be 1% or 2%, I have a working robot in mql4, but I only looking for best entries not even using SL or TP, so as mentioned just % reached, I've watching many videos from you really great videos, I love to code python as well and to find the best indicators tips and adjustments keep it up thank you.

    • @CodeTradingCafe
      @CodeTradingCafe  11 หลายเดือนก่อน

      Hi thank you for sharing, yes I agree with you actually I haven't introduced any proper trade management yet in these videos, I will get something ready showing the different ways of closing a trade, your percentage idea is also a good one! Good luck!

  • @janvosatka474
    @janvosatka474 10 หลายเดือนก่อน +1

    Hi nice video, please where could i find classes Strategy, Backtest from backtesting. Thx

    • @CodeTradingCafe
      @CodeTradingCafe  10 หลายเดือนก่อน

      Hi, thank you for your support, the classes are from a package called backtesting py you can install it using pip install backtesting and their web documentation is on git kernc.github.io/backtesting.py/ I hope this helps, Good luck!

  • @BenSacor
    @BenSacor ปีที่แล้ว +1

    Are you able to add the code into the mt5 platform to start testing it? I cannot seem to figure out how to enter into mt5 and test it.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      This is a python code it will not run in mt5, it has to be rewritten in mql5 language.

  • @KaFaiTam-kl6lr
    @KaFaiTam-kl6lr ปีที่แล้ว +1

    Interesting but, For my strategy list, I would BUY when RSI first time cross over 55 and reverse to sell when first time cross below 45 on day/week chart.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      that's one variation we can try maybe I can do it in a future video

  • @Thegiant4296
    @Thegiant4296 10 หลายเดือนก่อน +1

    How were you able to download intraday data that far back? I use pandas and I wanted to test the strategy using SPY however I can only go 60 days back. Is there a different library I can use to get intraday data for equities for more than 60 days?

    • @CodeTradingCafe
      @CodeTradingCafe  10 หลายเดือนก่อน

      Hi you can use dukascopy they have a lot of data, otherwise yfinance is faster and easier to get.

  • @andreagiunta168
    @andreagiunta168 ปีที่แล้ว +1

    hi there. I would like use Bollinger Bands and consider "lenght" and "stdev" as variables to be used within the optimization function. have you got some solving answer?!??!?! pllsssssss

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      It's relatively simple but the problem you will have to deal with the names of the Bollinger columns created by pandas_ta for each set of parameter. Other than that putting everything into functions and calling an arching function to execute all the files can work well.

  • @ikiyytours2320
    @ikiyytours2320 8 หลายเดือนก่อน +1

    Very nice.... can I use it in mt5

    • @CodeTradingCafe
      @CodeTradingCafe  8 หลายเดือนก่อน

      Hi, thank you! The language I am using is python so the code as is will not work in MT5 you will need to translate into mql5.

    • @ikiyytours2320
      @ikiyytours2320 8 หลายเดือนก่อน

      Thanks bruh....

  • @pedrocaluiz
    @pedrocaluiz 4 หลายเดือนก่อน +2

    Hello, thanks for video!!
    Please help me with the bt.plot, I have this error : ValueError: Length of values (2) does not match length of index (1)
    Do you know about that?
    thanks

    • @CodeTradingCafe
      @CodeTradingCafe  4 หลายเดือนก่อน

      it seems that you are trying to plot data with only 2 values and 1 index value, I don't where the mismatch is coming from, are you sure bt.run() completed successfully?

    • @egnatjovanich7661
      @egnatjovanich7661 หลายเดือนก่อน

      I also have the same problem, after run 'bt', it shows results, but after line bt.plot(show_legend=False)
      it shows error:
      "
      Data contains too many candlesticks to plot; downsampling to '1H'. See `Backtest.plot(resample=...)`
      ..... (many lines)
      ValueError: Length of values (2) does not match length of index (1)

  • @rgodim
    @rgodim 7 หลายเดือนก่อน +1

    Great content, would it be possible to access strategy code? Thank you❤❤😊

    • @CodeTradingCafe
      @CodeTradingCafe  7 หลายเดือนก่อน

      Hi, sure, check the link in the description of the video. Good luck!

  • @yoscout5919
    @yoscout5919 7 หลายเดือนก่อน +1

    can i ask you from where did you download all the historical data? my broker doesn't let me go more than 2 months back on the 1m data

    • @CodeTradingCafe
      @CodeTradingCafe  6 หลายเดือนก่อน

      A full video about it just for you :) th-cam.com/video/yunQT598664/w-d-xo.html

    • @yoscout5919
      @yoscout5919 6 หลายเดือนก่อน

      @@CodeTradingCafe thanks appreciate it :)

  • @gert1234aqwss
    @gert1234aqwss 7 หลายเดือนก่อน +1

    Hi
    I justed came across this video.
    How to apply the strategy?
    Is it opening with tradingview?

    • @CodeTradingCafe
      @CodeTradingCafe  7 หลายเดือนก่อน

      Hi, no need to use tradingview it's all through Python, and this is mainly for backtesting ideas.

  • @jaafarjrm5160
    @jaafarjrm5160 9 หลายเดือนก่อน +1

    Thapnk you about all info how can i use this code on live account apfter i download it

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน

      You will have to modify the code to connect to your broker's API, this shown how in this video: th-cam.com/video/WcfKaZL4vpA/w-d-xo.html

    • @jaafarjrm5160
      @jaafarjrm5160 9 หลายเดือนก่อน

      @@CodeTradingCafe can I make it work as expert advisor on mt5

    • @CodeTradingCafe
      @CodeTradingCafe  8 หลายเดือนก่อน

      Hi, you will have to translate into mql5 language.

  • @WhiteSiroi
    @WhiteSiroi ปีที่แล้ว +1

    WOW

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      I liked this one too as a starting point, just don't forget fees are discarded here, but it's a good base strategy to develop...

  • @Aram-SEMO
    @Aram-SEMO ปีที่แล้ว +2

    Hello, how we can make a strategy only long position that includes the vwap without stop loss and take profit. did i miss the video ?

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hi, well it's kind of easy simply comment the lines where sell positions are opened and erase the SL TP from the function, but how will you backtest this if it never closes a position

    • @Aram-SEMO
      @Aram-SEMO ปีที่แล้ว +2

      @@CodeTradingCafe To close the position use another indicator, why i don't use SL and TP because after so many tests me and my best friend the 'AI' 😅 we find out that it's not good to use it,
      """ I don't encourage anyone not to use SL and TP, do your own research and testing , good luck 🤗 """,
      i use several vwap z-score indicators and other indicators like sma cross for example to open or close the position I try to do it with the backtest library and I don't have the same result with my back_test script.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Ah ok I understand, thank you for your reply!

  • @talhakaracallik1352
    @talhakaracallik1352 2 หลายเดือนก่อน

    Hi, which order type should ı use for this trasing strategy ?

    • @CodeTradingCafe
      @CodeTradingCafe  2 หลายเดือนก่อน

      Market orders, not sure if this answers your question.

    • @talhakaracallik1352
      @talhakaracallik1352 2 หลายเดือนก่อน +1

      Thanks@@CodeTradingCafe

  • @Life2Live4u
    @Life2Live4u 3 หลายเดือนก่อน +1

    Спасибо

  • @ithaca2076
    @ithaca2076 ปีที่แล้ว +1

    10:35 you should make a discord so that we can talk about and share ideas for trading

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, I tried in the past it was too much to manage, I find the comments section here easier to follow

  • @gusalexanian5454
    @gusalexanian5454 ปีที่แล้ว +1

    How would we go about optimizing parameters in this strategy as well as any others? Is there a universal way to do it?

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hi, thanks, I think optimization can be done using different libraries, there is a module in backtesting package I should have a look at it.

    • @gusalexanian5454
      @gusalexanian5454 ปีที่แล้ว

      @@CodeTradingCafe It would be awesome to get a video on this. Love your videos thanks man

    • @CodeTradingCafe
      @CodeTradingCafe  11 หลายเดือนก่อน

      For some reason I didn't receive your comment it was flagged as spam by YT sorry about this!

  • @pobchubbington6759
    @pobchubbington6759 หลายเดือนก่อน +1

    In a strategy ive back tested ive managed to get 3.14 sharpe ratio, i heard if its too high youd need to be careful? My startegy is High frequency trades so the commission is rediculous when i factor it in... Which reduces the sharpe ratio quite alot - how can I reduce commission costs?

    • @CodeTradingCafe
      @CodeTradingCafe  หลายเดือนก่อน +1

      You can check if your broker has low commission accounts, or look for a different broker for this. Some brokers offer no commission trading as long as you don't leave trades opened overnight. But spread will always be there.

    • @pobchubbington6759
      @pobchubbington6759 หลายเดือนก่อน +1

      @@CodeTradingCafe Ou very nice to know! - Which brokers are commisionless? And allow you to integrate trading algorithms into their broker.

    • @CodeTradingCafe
      @CodeTradingCafe  หลายเดือนก่อน +1

      It depends where you are located, different places have different rules for brokers, I know in the Middle East for example CFI have no overnight commissions on Forex, just an example, Oanda have different types of accounts with different fees but come need a minimum deposit amount.

    • @pobchubbington6759
      @pobchubbington6759 หลายเดือนก่อน

      @@CodeTradingCafe im based in UK, which zero commission broker could i use? Im excited to test out the algorithm in live trading!

    • @pobchubbington6759
      @pobchubbington6759 19 วันที่ผ่านมา

      @@CodeTradingCafe?

  • @juscog
    @juscog ปีที่แล้ว +1

    Could you modify this that we can use it to trade using 3commas API with OKX exchange API?

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      I think yes, I haven't tried OKX since crypto crumbled, but I guess their API should be easy to code.

  • @atreushouse8848
    @atreushouse8848 ปีที่แล้ว +1

    trying to learn python and stumbled onto this, how can i incorporate it or what are things needed to make this a trading bot

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi you can check this one th-cam.com/video/WcfKaZL4vpA/w-d-xo.html a live trading bot example

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      ...and good luck with your learning

  • @kevinsherrard
    @kevinsherrard ปีที่แล้ว +1

    Can you do a video using the qfl strategy?

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi it's possible not complicated, only thing I have to wait until time allows.

    • @kevinsherrard
      @kevinsherrard ปีที่แล้ว +1

      @@CodeTradingCafe I appreciate it i am trying to write my own, but I am stuck trying to identify bases.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Check this video it might be of help th-cam.com/video/aJ8Og-iLaas/w-d-xo.html

  • @paulb9842
    @paulb9842 7 หลายเดือนก่อน +2

    is there a follow up video to this strategy?

    • @CodeTradingCafe
      @CodeTradingCafe  7 หลายเดือนก่อน +1

      Good point! there should be, but so many ideas came up and never got back to this one.

  • @synetic3976
    @synetic3976 ปีที่แล้ว +1

    Hi I dont know about python , please tell me how different from backtest by mt4.
    Thank you.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +1

      Hi, it can be almost the same for many applications and backtesting only python becomes more powerful for advanced numerical analysis and data visualization such machine learning and neural networks if needed, also you can deploy python into a container on the cloud to keep it running. Some of these features are not needed if you just want to backtest a relatively simple system.

    • @synetic3976
      @synetic3976 ปีที่แล้ว +1

      @@CodeTradingCafe Thank you.

  • @pritamsarkar2075
    @pritamsarkar2075 9 หลายเดือนก่อน +1

    Where can I find all the theories behind these?

    • @CodeTradingCafe
      @CodeTradingCafe  9 หลายเดือนก่อน

      Hi, there are some books out there, but you will not find everything in one reference, it's mainly gathering what you need from a list through months/years. That being said any data science and analytics theoretical reference can be useful, I use regression a lot for example this is well detailed in statistical mathematics references. I hope my answer makes a bit of sense.

  • @thinketh2408
    @thinketh2408 ปีที่แล้ว +2

    Hi sir how to identity if strategy is good..
    Like what should be it max draw down percentage and period,, profit, sharpe ratio etc....

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, depending on how much risk you want to take, you can have extra safe strategy but only 1 percent return per month or very high risk and more return. All the parameters will change accordingly.

    • @thinketh2408
      @thinketh2408 ปีที่แล้ว +1

      @@CodeTradingCafe thanks mate... I wanted to know you preference regarding this...
      Like what should be the minimum sharpe ratio and maximum draw down before you start using the strategy for real trading...

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว +2

      I would say Sharpe ratio minimum 2 preferably 2.5 with spread fees included is a good start

    • @thinketh2408
      @thinketh2408 ปีที่แล้ว +1

      @@CodeTradingCafe thanks

  • @Asparuh.Emilov
    @Asparuh.Emilov 11 หลายเดือนก่อน +1

    I would like to know if actually you are able to make money using any of the algorithmic approaches? How difficult might be to get passive income although not too high?

    • @CodeTradingCafe
      @CodeTradingCafe  11 หลายเดือนก่อน +1

      Hi, I get this question a lot, short answer yes you can but is much less than people think (8-14% per year). If you want more return you can use algorithms to send you notifications and execute the trades yourself and manage opened trade manually this is more profitable but also comes with more effort. Good luck!

  • @loganbishop4619
    @loganbishop4619 6 หลายเดือนก่อน +1

    So if we are checking the VWAP and STDV, if something is above 2 STDV, then by definition, it is above VWAP. So, why check both? Maybe I am confused about the calculation, but this should be true if STDV is calculated from VWAP. Maybe if it is from regular average, then it could be different. Let me know your thoughts.

    • @CodeTradingCafe
      @CodeTradingCafe  6 หลายเดือนก่อน

      Hi, you have a good point! the stdv is computed from the moving average, but also the VWAP is used to test if consecutive candles are above or below the curve, the stdv is used only on the current candle. I hope it's a bit clearer.

  • @albertovidalfernandez112
    @albertovidalfernandez112 ปีที่แล้ว +1

    How we could transform our time when It is in the epoch formato. Thank u!

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi, I don't understand what epoch format means, but in python you can do almost any format transformation

    • @albertovidalfernandez112
      @albertovidalfernandez112 ปีที่แล้ว +1

      @@CodeTradingCafe epoch is the time since 1970

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      I see, I guess you can still use the datetime function and make format changes.

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      I see, I guess you can still use the datetime function and make format changes.

  • @Summerlfo
    @Summerlfo ปีที่แล้ว +1

    Hey, could you code this strategy
    Plot 5 period Ema on 5 mins, when the candle closes above 5 period ema “without touching ema line”, and the next candle start trading below low of signal candle ,we short the market.
    SL in short trade is high of previous candle
    TP Is usually 3 times of SL
    For long trade we have to switch from 5min to 15 min and the process is just opp of short trade !

    • @CodeTradingCafe
      @CodeTradingCafe  ปีที่แล้ว

      Hi thank you, can you send me an email with a photo example? I don't get the "next candle start trading below low of signal candle" part.