Live Trading Bot Strategy In Python

Поделиться
HTML-код
  • Опубликовано: 31 янв 2024
  • This time, finally, we delve into the world of live trading bots using Python. In this session, we test a strategy that was previously optimized and backtested, implementing it into a live trading bot connected to the market. This allows us to evaluate its performance under real market conditions, including spreads, commissions, and trading fees.
    Our strategy involves detecting price trends using the exponential moving average and choosing entry points using Bollinger bands. These methods were introduced in a previous video and optimized for optimal parameters. The backtest results showed a return of 61% over approximately 35 trading days.
    We discuss the Stop Loss (SL), which is defined relative to the Average True Range (ATR), and the Take Profit value, which is also related to the Stop Loss distance. We also highlight that some weeks may yield negative returns, reminding viewers of the inherent risks involved in trading.
    We then proceed to walk through the Python code, demonstrating how to run the live test. I encourage viewers to apply this strategy to different assets and share their findings in the comments section.
    Stay tuned for more videos on this topic, and until our next meeting, trade safely.
    💲 Discount Coupon for My Course on *** Algorithmic Trading***:
    bit.ly/CouponAlgorithmicTrading
    💲 Discount Coupon for My Course on *** Data Analysis with Numpy and Pandas***:
    bit.ly/CouponDataAnalysis
    The code I used in this video for download:
    drive.google.com/file/d/1zNNP...
    The previous video detailing the strategy:
    • Trading with Python: S...
    #algorithmictrading #tradingbots #algotrading #forex
  • НаукаНаука

Комментарии • 207

  • @Zenoandturtle
    @Zenoandturtle 3 месяца назад +4

    I’ve been working on my own trading bot since last year. These videos are immensly helpful. Thanks for the amazing work. I’ve also been exploring your earlier vids, they are fantastic.

    • @CodeTradingCafe
      @CodeTradingCafe  3 месяца назад

      Glad you like them! Thank you for your support!

  • @johnsnow6792
    @johnsnow6792 4 месяца назад +3

    Thank you for creating these videos, they're exactly what I have been looking for!

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thank you for your support! Glad you like these vids.

  • @derrickjones5282
    @derrickjones5282 4 месяца назад +5

    Exciting! Hopefully it works out! Looking forward to the final analysis!

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +3

      Thank you for your support. More to come, but it's a bit slow since I need to wait for the bot to gather some real time data.

  • @ggirs92
    @ggirs92 3 месяца назад +2

    Thanks for your dedication on sharing your knowledge, learning and findings, you've earned a new supporter 🙂

  • @revbem141
    @revbem141 4 месяца назад +9

    FYI. when you request candles, the most recent candle will not be complete ("complete"=false), aka still forming. You need to filter this candle out to get the most accurate signals [x:-2].

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +2

      Hi thank you, I thought the last uncomplete candle is Not considered because python discards the upper edge of the slice by default so if we use [:-1] the -1 candle (current candle) is discarded. But which line of code you were referring to exactly so I can check it out?

    • @revbem141
      @revbem141 4 месяца назад

      @@CodeTradingCafe You are right about [:-1] (forgot about inclusive/exclusive). I'm not familiar with oanda_candles since i use oandapyv20 directly for everything. It might be that that package sorts it out. This is a response i get when requesting 1 candle - {'instrument': 'EUR_USD',
      'granularity': 'M1',
      'candles': [{'complete': False,
      'volume': 21,
      'time': '2024-02-01T21:29:00.000000000Z',
      'mid': {'o': '1.08704', 'h': '1.08706', 'l': '1.08704', 'c': '1.08704'}}]} everytime there is a tick the values change.

    • @revbem141
      @revbem141 4 месяца назад +1

      It's an edge case but It can be annoying when you get a signal in one moment and then not in the next because the price has moved slightly.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Well honestly I am never sure of edge cases until I try many times and observe what's happening, funny it's one tedious task :)

  • @leandrogoethals6599
    @leandrogoethals6599 4 месяца назад +21

    Wow as requested by many u listened keep it up!

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +3

      More to come! live testing and analysis on live trades, but it's kind of slow because I need to wait for the bot to gather enough data (2-3 weeks I guess).

    • @loqasheltner120
      @loqasheltner120 4 месяца назад

      @@CodeTradingCafe which broker used here

  • @martinwahlberg4932
    @martinwahlberg4932 4 месяца назад +2

    This is really great! Thank you for sharing! 🙏

  • @oliverpolden
    @oliverpolden 4 месяца назад +2

    Always interesting to see how you are doing things different to what I would do. In terms of coding standards, I would do an "early return" on the spread, i.e. if the spread is too large, then return out of the function, then you don't need to put it in your if/elif later on which would simplify your code.
    As you mentioned, the number of units would be calculated relative to the stop size such that you're consistently risking say 1% of your account per trade.
    I'm currently at a position where I can easily backtest and optimize a strategy. I now need to write some code to trade the same strategy in my broker account. Will be interesting to see how the live results compare to the backtest results and of course I'd like to try the strategies you've outlined.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, thank you, I also enjoy your comments, somehow pushing for a better code (which I never focus on at first and then when the code is done and running I don't go back to improve it :) ). But regarding the strategies, lots of ideas around one strategy (this one in the video) there many ways to test it now, I am also thinking of higher timeframes but the trades number would be less so it's more waiting time. I will take it one step at a time, and see where it leads... and I will write better code but not for this Thursday because I already recorded the videos, sorry :)

  • @tramesh007
    @tramesh007 4 месяца назад +4

    Great work. I taken your course on Udemy which is also excellent. I am planning to use this index option trading(India). I will test with small amounts with brokers in India and provide the feedback. Again Thanks a lot for sharing the Python code :)

  • @VoltaireParis
    @VoltaireParis 4 месяца назад +1

    awsome, thanks for sharing this !!

  • @a-m-vclips9653
    @a-m-vclips9653 4 месяца назад +3

    We'd love a video stating the top 5 strategies of the channel

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      It's hard to sort the strategies they are different running on different timeframes, some are for ranging markets others for trending markets, the best strategy is a combination of strategies like the ensembling idea in ML.

  • @a99pu
    @a99pu 4 месяца назад +2

    your explanation is easy to understand thx for the video

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Glad to hear that! Thank you for your support.

  • @tudatostrader
    @tudatostrader 4 месяца назад

    Just bought your courses. Love your work. You keep giving and sharing! Hope you will do very well.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Much appreciated! thanks a lot for your kind support, and good luck to you!

  • @anypuppet
    @anypuppet 4 месяца назад +2

    Very exciting! How about adding a sentiment analysis to the strategy? Perhaps based on machine learning? :)

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Great suggestion! I thought about it and I am still postponing this since a year lol... but I will get there one day.

  • @JamesMoore-zg7tr
    @JamesMoore-zg7tr 4 месяца назад +1

    Awesome tutorial man, been looking into this for a while. Assuming I can use any platform that allows API generation?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Yes, absolutely you have brokers that allow python trading through their APIs (IB, Binance, Oanda...)

  • @bombasticiti
    @bombasticiti 4 месяца назад +1

    Thank you bro! For what you do!

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thank you for your support! Glad you liked this one.

  • @randomdude7386
    @randomdude7386 4 месяца назад +1

    I tested the strategy on BTC/USD and ETH/USD pairs, they did decently on more recent data, whilst data from around 2020 caused long term draw downs on the 1 minute timeframe. Over all the strategy did really well

    • @thinketh2408
      @thinketh2408 4 месяца назад

      .. Which TF worked for eth and BTC...

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +3

      Thank you for the heads up. I think the best way to use this strategy is to optimize it (the parameters ruclips.net/video/IfoZaCGTJ_Q/видео.html ) every couple of weeks somehow keeping up with the current market. the 1 minute timeframe is too noisy for my liking, I will try 15min maybe for the next video.

    • @digital4smallbusiness
      @digital4smallbusiness 4 месяца назад +1

      I tried it on a 15 mns window, 😢

    • @Rohit_behind_DecadelTrend
      @Rohit_behind_DecadelTrend 2 месяца назад

      @@CodeTradingCafe But if we keeps on optimizing the strategy in couple of weeks , arent we running a curve fitted system then ?

  • @a-m-vclips9653
    @a-m-vclips9653 4 месяца назад +1

    Thank you a lot for your works

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thank you for your support! Glad you like these videos.

  • @alwikah5664
    @alwikah5664 4 месяца назад +1

    Great !
    Concise and helpful! Thanks alot!
    Is it possible to test with MT5 demo account and adapt the code with only MT5 Python API functions?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thank you, I think I will prioritize MT5 python interface now, I am getting a lot of requests on this topic.

  • @301resa
    @301resa 4 месяца назад +1

    looking forward the follow up video :) maybe 2 weekly update please?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      :) I am waiting to gather more data, since drawdown periods can last 3 weeks according to the backtest.

  • @Exzal123
    @Exzal123 4 месяца назад +1

    Hi !
    It's not really related to this video but I'm getting confused on how I should organize my codes around strategy building...
    Do you have a video about that ?
    Like, do you group your functions, if so how and where ?
    How do you sort your data, your results ?
    Thanks !

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      I absolutely support your question, simply because I am too messy with my codes and I am not doing great/elegant codes here on the channel. Ideally I wouldn't even use a notebook, just a python file, makes it easier to organize putting functions in different files depending on their usage and importing these files in the main code. That would be a good start. for the results the easiest is to put these in excel if you are trying different strategies for comparison.

  • @lorenslobo7403
    @lorenslobo7403 4 месяца назад +2

    Amazing !

  • @pumacamargo
    @pumacamargo 4 месяца назад +2

    Great video! thank you for great content, would it be possible to make one video of a trading bot that uses a simple stradegy but trades multiple symbols? 🙏

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +2

      Hi thank you, yes. actually this bot can be used for other currencies as well but you need to change the parameters a bit.

    • @sankyuubigan
      @sankyuubigan 4 месяца назад

      @@CodeTradingCafe what parameters should I adjust to make the strategy suitable for different symbols? TP and SL ?

  • @rezasadeghi2520
    @rezasadeghi2520 4 месяца назад +1

    Thank you so much

  • @invest-design3054
    @invest-design3054 4 месяца назад +1

    This is soo cool...now, is that visual studio code you are using? And is there anything else needed for trades to happen on live data.?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, thank you, yes it's VSCode and you just python and some packages that you can easily pip install

    • @invest-design3054
      @invest-design3054 4 месяца назад +1

      @@CodeTradingCafe alright thank you very much..

  • @christophermatthews4896
    @christophermatthews4896 4 месяца назад +1

    can’t wait to see the update. you should do weekly updates of this trading bot

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      It's slow, and sometimes technical issues :) but it's nice

    • @AwesomeMrT-007
      @AwesomeMrT-007 2 месяца назад

      @@CodeTradingCafe would love to know the issues and solutions.

  • @abdsh422
    @abdsh422 4 месяца назад +1

    Nice video. For me, the hardest part was watching the bot lose money and doing nothing because it is part of the statistics. However, I faced two issues and I am not sure if you encountered them or not:
    1- There is a 5% difference between the backtest and the real trading (Not in the equity, it is in the trading decisions.), which makes a difference.
    2- The bot was sensitive to the economic news in a negative way.
    However, it is making money in the end, but it needs more than a month to confirm that it is aligning with the backtest results.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Hi, there will be definitely a difference due to spread and fees, I honestly would't expect to get exactly the same results as the backtest, but if the backtest was good I expect the live trading to be good as well, less returns but still Ok. I hoe it will still go in the the positive direction.

    • @abdsh422
      @abdsh422 4 месяца назад +1

      @@CodeTradingCafe i was referring to something else on my comment.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Hi, I reviewed the code and there was a small delay in the live version (signal should be applied to open prices instead of closing prices) so it will execute trades like in the backtest, unless if there is another bug. I am trying it again for few weeks now...

    • @abdsh422
      @abdsh422 4 месяца назад +1

      Thank you for the update. One point to note is that during backtesting, discussions will not apply to the subsequent candle, which means it won't show that the position was closed. As a result, the backtest may indicate fewer consecutive failures than what might occur in reality. To clarify, I'm currently using another bot that has been yielding decent results. I've been testing it with a live account (real money), and it performed poorly when there were announcements from the USA regarding the economy.
      If you don't mind, I would like to use your bot in conjunction with the one I currently have. This approach could potentially increase the number of trades while maintaining an acceptable win rate.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Thank you for the heads up, I am currently fine tuning the bot during live trading it's a lot of trial and error I deploy it today on AWS because I was having some technical issues mainly connection and firewall... this also adds up to the challenge. Regarding using this bot, sure feel free, just be cautious it's not the best version yet. I am testing the same bot with trailing stop also I will make a video as soon as I get something.

  • @foliveir84
    @foliveir84 4 месяца назад +1

    Great content, I already enrolled you course and it's also great. One question, each trade with 3k units is the same as your are opening trades off 3k$?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, almost yes if EUR is 1.15 USD for example it would be 3450 USD

    • @foliveir84
      @foliveir84 4 месяца назад +1

      Thanks for the fast replying, but in the best profit days is something like 0,3%, it's not a risk strategy apply 3.5K to get 10€? I mean, if it was 100% percent right I would apply more, but it's a little scary

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      You are right, I also missed the leverage, so the margin is almost 115 instead of 3500 USD, but yes it's aggressive lot sizing, however you are not risking the whole amount of the margin it's just the lot size until the stop loss that's the real risk value. So it's a high lot size but considering the SL distance we're just risking small part of the margin. I hope this makes sense.

  • @Organism1024
    @Organism1024 4 месяца назад +1

    Great content, I just have one question: how do you connect to oanda using the API? I have a paper account and a live account but I don't know how to connect to it in my live account, I hope you know how to do it. Greetings from Mexico

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, you need to generate a token from Oanda web platform and you will need the account number. Check on Oanda's there is a selection "API" on the left menu, you can generate a token there, then use the token and account number in the code provided in my video.

  • @henri-le9rf5kl1k
    @henri-le9rf5kl1k 4 месяца назад +1

    hi, very nice code. on which platfrom are you running the code over the time?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      AWS cloud, using EC2, elastic compute.

  • @FALCON_619
    @FALCON_619 4 месяца назад +3

    Thanks!

  • @sergiobarbosa9039
    @sergiobarbosa9039 2 месяца назад +1

    Hi! Nice work and thank you for all. Im trying to implement the code to use on my platform xtb, can you help? Or maybe do a video on xtb? Thanks again.

    • @CodeTradingCafe
      @CodeTradingCafe  2 месяца назад +1

      Hi, I have never used xtb, you might need to go through their documentation following the same structure from the codes in this channel.

  • @highlander926
    @highlander926 4 месяца назад +1

    Thank you for sharing this code
    It would be great if you implement the CCXT library to it. Then we can connect it to different crypto exchanges
    sorry to ask, but I am not technical

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thanks for the idea! it's on my list but time is always tight...

  • @smurththepocket2839
    @smurththepocket2839 4 месяца назад +1

    Looking good :) what about your transactional fees at your broker. I don't see where you take this into account.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, they are directly withdrawn from my account I can see them in the history. so far it's all positive let's wait few more weeks and see...

  • @dcchase8225
    @dcchase8225 4 месяца назад +2

    Please let me know how to Apply these Strategies in the Indian Derivatives Market ?😊

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      I am not familiar with Indian market, but I Assume with a little bit of tuning a good strategy should perform well on any chart.

    • @dcchase8225
      @dcchase8225 4 месяца назад +1

      @@CodeTradingCafe Can you help me with Nifty Banknifty indices Strategy ?

  • @preetipics
    @preetipics 4 месяца назад +2

    awesome, thanks for getting to this one..more please :)

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      More to come! Thank you for your support.

  • @muhireinnocent2371
    @muhireinnocent2371 4 месяца назад

    Thanks for the video, but my question is what if you use 9 and 21 emas for trend detection wouldnt make the bot capture more market trades.
    whats your say on that?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      There is only one way to find out, backtesting and forward testing.

  • @ChroniclesThroughTime
    @ChroniclesThroughTime 4 месяца назад +1

    Can we get trading journals from this library “Backtesting”…?
    If not then can you please create one video on how to create a complete Python function as same as Library “Backtesting” where we can all details how to analyse.
    Thanks in Advance…!

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Actually yes you can, you have access to all the trades in the results. You can extract these there is a variable named _trades if I recap correctly.

  • @bakrob99
    @bakrob99 3 месяца назад

    Do your results factor in commission and slippage? When I was trading futures 2007 to 2014 using Tradestation language, (which is very powerful and simple), I was only able to get decent returns using a 15minute chart or higher. Thanks for your videos.

    • @CodeTradingCafe
      @CodeTradingCafe  3 месяца назад

      I agree higher timeframes are easier for systematic trading, less noise. I don't add commissions and trading fees unless the strategy is doing really well, I start testing raw indicators (no trading fees or slippage). There is an easy way to add these in backtesting just pass the parameter commission=0.0002 (spread for forex) and increase the number depending on the broker's fees approximations.

  • @aligamal9524
    @aligamal9524 3 месяца назад +1

    I saw a couple of videos were you used LSTM for predicting stock prices and if i remember correctly it was futile, have you tried using transformers? I'm trying that. If it doesn't look futile, I'll let you know.

    • @CodeTradingCafe
      @CodeTradingCafe  3 месяца назад

      Hi, no I haven't yet, it takes time and I was skeptical if it's worth it, but you are right what if transformers can predict the most probable sequence continuation... at the end this is how it works for LLMs. Good luck with this, if you have time and something interesting I would be curious to know.

    • @aligamal9524
      @aligamal9524 3 месяца назад +1

      @@CodeTradingCafe I'm skeptical too, but even of it doesn't work i hope to learn something out of it. Anyways it's a long journey to learn. If something looks promising I'll be sure to let you know. Also i think it would be good for you to have a discord or something for the community to also share their journey so that we can cover more ground as a collective.

    • @CodeTradingCafe
      @CodeTradingCafe  3 месяца назад +2

      Hi , thank you for your feedback, well the coding and learning will definitely be fun especially when the code runs at the end (you will probably forget about the trading money and stuff lol). Discord or telegram is too much for me to moderate, I am barely keeping up with youtube :)

  • @henri-le9rf5kl1k
    @henri-le9rf5kl1k 4 месяца назад +1

    Hi, very nice code. On which plattfrom are you running the code ?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +2

      AWS cloud, using EC2, elastic compute.

  • @MoreInspirate
    @MoreInspirate 4 месяца назад +1

    Good job

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Thanks, thank you for your comment.

    • @MoreInspirate
      @MoreInspirate 4 месяца назад

      I actually test this strategy i add lots/volume calculation with risk management 1% on EURUSD and XAUUSD

  • @dennismenace5174
    @dennismenace5174 4 месяца назад +1

    Thats good for real

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Well it's just few days now, hopefully next week will be good as well.

  • @apogounte8239
    @apogounte8239 4 месяца назад +1

    Amazing! Would u be kind enough to provide a csv or an excel file, with the exact entry points of the strategy, to be able to have as a reference?
    Having checked a single day, the entry points for long that lost would be
    date
    2024-01-24 02:30:00
    2024-01-24 14:00:00
    2024-01-24 16:50:00
    2024-01-24 17:05:00
    and the entry points for long that won, should be
    date
    2024-01-24 00:10:00
    2024-01-24 03:05:00
    2024-01-24 10:40:00
    2024-01-24 13:35:00
    2024-01-24 14:30:00
    The above return in pips is ~6.5 pips
    Can you please confirm?
    Keep up the superbe work!
    Thanks

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, thank you for your support. Yes that would be possible, but I will have to reset the account because I used it to test different strategies, so the best is I reset the account run the strategy for 3 weeks and provide a clean csv, the format of the csv however id the one provided by Oanda there is all the information there but you will need to select whatever you need from it.

    • @apogounte8239
      @apogounte8239 4 месяца назад +1

      @@CodeTradingCafe another option would be to just run the code inside the notebook u had provided in the previous video when u introduced the strategy, and save the entry points in a csv. What do u think?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Yes I agree it works well, I am intending to run 2 versions of the code, one that we know and another one using trailing stop, put them in a race, and save trades for both, could score each trade if long or short, the SL and TP values, the price and date, and if the profit loss numbers for each trade.

  • @neerajdeswal1207
    @neerajdeswal1207 4 месяца назад +1

    please make a video live on Indian market like Nifty or Banknifty ,may be on paper trade and see the result.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, I have no experience in the Indian market, try to adapt any of my codes if you have been trading Indian assets you will probably do better than me.

    • @jaisonranchhod6646
      @jaisonranchhod6646 4 месяца назад

      Bro, the code is there, give it a go and share the results

  • @santo3vong40
    @santo3vong40 4 месяца назад +1

    So among the algorithms you wrote, which one is the strongest?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      They all have ups and downs depending on the market, usually you would have 2 or 3 running in parallel and covering up for each others to be always in the positive. Some I can't publish because they were done for clients. The best is to have a hybrid approach, so the algorithm send you an alert for an opportunity and you decide if you need to open the trade or not, this was my best experience and by far the most profitable.

    • @santo3vong40
      @santo3vong40 4 месяца назад +1

      @@CodeTradingCafe thank you

  • @TiktakGames78
    @TiktakGames78 4 месяца назад +1

    Hello, how can I run your robot in Metatrader?.
    Is there a specific platform?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, this doesn't run in Metatrader you need to run it only in Python, so a minimum coding level might be required. But if you don't know coding you can still trade the strategy manually it's a great simple and very easy. The backtest shows good results as well check it here ruclips.net/video/IfoZaCGTJ_Q/видео.html

  • @FArya-xt5kx
    @FArya-xt5kx 4 месяца назад +1

    Sir if I run it live trading bot in While Loop,,, what problem will faces? and which is better scheduler or whileloop.... thank U..I m from india

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, it wouldn't work unless you add a sleep function of 5 minutes, scheduler works better in this case. Good luck !

  • @Net_Runners
    @Net_Runners 4 месяца назад +1

    Good job!
    Does it work with Crypto exchanges like Bybit , Binance ... ?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      The way it is now it works on Oanda, for other platforms we need to use different API.

    • @Net_Runners
      @Net_Runners 4 месяца назад +1

      Thanks for respond
      Are you have to change the whole script for that?
      @@CodeTradingCafe

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Not all but the part where it connects to the market so, let's say half of the code.

  • @alinolteanu1962
    @alinolteanu1962 4 месяца назад +1

    Hey, nice material right here! Thank you for the information! One question: how do you take the candle.ask.o value? I don't see any ASK field in DataFrame

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      I think I am not using it it's just a test to see if I can get the data.

    • @alinolteanu1962
      @alinolteanu1962 4 месяца назад

      @@CodeTradingCafe you are using it for the spread.

    • @alinolteanu1962
      @alinolteanu1962 4 месяца назад

      @@CodeTradingCafe You are using it for spread.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Yes below in the trading part, I thought you meant the previous part where I test the candles download.

    • @alinolteanu1962
      @alinolteanu1962 4 месяца назад

      @@CodeTradingCafe Yep, in the trading part. I was curious where I can find that information about ask field, it seems like XTB doesn't bring that field.

  • @lokeshart3340
    @lokeshart3340 4 месяца назад +1

    Will it take our money and invest it automatically? And pls make a ultimate python trading bot with AI ML and aal the strategies possible with AI prediction the stock price etc

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      It's a good example if you are trying to learn python for algorithmic trading, I wouldn't advise using a program if you're not familiar with the code. That being said you can always use the strategy manually it's proven that it works.

  • @allfatherasia5579
    @allfatherasia5579 4 месяца назад +1

    Im curious, can we make the script to be able to run on 2 pairs or more instead of just one pair. I mean ofc i can just run another script again but is it possible to run it on the same script?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Yes the idea to do it this way, run it on uncorrelated assets, but you also need new set of parameters so going back to my previous video on optimization.

    • @garkeiner2342
      @garkeiner2342 4 месяца назад +1

      I recommend "Leveraged Trading" (beginners) and "Systematic Trading" (more sophisticated framework) by Robert Carver. I recommend them in general, but he has a framework to use different rule sets on different instruments in a single system. It considers the overall capital, allocates towards the subsystems depending on current risk estimations and more. And it is relatively simple.

  • @nicolinpadayachee190
    @nicolinpadayachee190 4 месяца назад +1

    Hi , i have a set amount of trading rules , i want to find out how can i automate this ? Is there someone i can hire to code it for me and if so where can i find them ?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      I would have said I can do it, but currently I am overbooked, if the rules are relatively simple send me an email with a description, but if you assume it's complex or might be time consuming at the moment can't do much.

  • @er-gec2546
    @er-gec2546 4 месяца назад +1

    hi, i have a question if you help. İ wrote a code and it runs for a coin. but i can not run two or more different coins at the sime. How can we run two or more codes at the same time in python

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      The way this code in the video is built you will need to run different codes for different assets, it's not adapted for multi currencies.

    • @er-gec2546
      @er-gec2546 4 месяца назад

      @@CodeTradingCafe i am not sure that i could ask properly. İ mean in python i can work only one code at the same time. i want to run for examle 5 the same codes for different coins etc and i can not do it. My question is related to python not to a code. İ thought you may know the answer

    • @thinketh2408
      @thinketh2408 4 месяца назад

      ​@@er-gec2546use loops for each coin...

  • @joko2851
    @joko2851 4 месяца назад +1

    I have downloaded the file...can it be transferred to tradingview.how do I change this file to an indicator in tradingview

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, unfortunately no, this is python and tradingview use pine I guess.

  • @noob_on_a_grind2431
    @noob_on_a_grind2431 4 месяца назад +1

    Could you show how to implement this on a trader that does not require fully verified accounts to access the API on a paper account?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      As far as I know, not aware of any platforms offering APIs without verifying and getting your details.

    • @noob_on_a_grind2431
      @noob_on_a_grind2431 3 месяца назад

      @@CodeTradingCafeOkay, thanks for the answer. I saw there is MetaTrader5 Libary for Python so it seems there is a possiblity to hook python scripts to MT5 terminal which would make it universal to all brokers as nearly all of them offer metatrader access to the markets. Maybe that would be a nice idea for a future video. Thanks for you content.

  • @thinketh2408
    @thinketh2408 4 месяца назад +1

    Bro please do video on vector BT..

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Man I know, I am really sorry, I am not efficient these days.

    • @thinketh2408
      @thinketh2408 4 месяца назад +1

      @@CodeTradingCafe may GOD bless you

  • @MisterPDR
    @MisterPDR 4 месяца назад +1

    wow cool man!

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thank you for your support! wish this bot a good luck :)

    • @MisterPDR
      @MisterPDR 4 месяца назад +1

      @@CodeTradingCafe definitely wishing you good luck! would be great if you could perform a slippage analysis after you have gathered some data (suggesting at least 6m) - i.e. take real results and backtest results for same period and calculate the difference in result :)

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      This is one great idea! comparing the bot to backtesting on the same period! Thanks!

  • @NeuralHackswithVasanth
    @NeuralHackswithVasanth 4 месяца назад +1

    Is this paper trading of real trading which involves money?

    • @randomdude7386
      @randomdude7386 4 месяца назад +1

      Considering he is live testing this bot, I would assume its paper trading
      Edit: fixed spelling

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +2

      Hi, yes it's a paper account, for testing but I noticed fees are included and the spread of course, ... and we are sure there is no look ahead bias in this case.

    • @NeuralHackswithVasanth
      @NeuralHackswithVasanth 4 месяца назад +1

      @@CodeTradingCafe cool thanks

  • @thinketh2408
    @thinketh2408 4 месяца назад +1

    Bro share strategy backtesting ideas for crypto... It's 24hr market.. Mostly ETH and BTC Can be good...

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      I never traded crypto, I was just investing (which was a bad idea). Does is move as quickly during sessions off too?

    • @thinketh2408
      @thinketh2408 4 месяца назад

      @@CodeTradingCafe hmm never taken in to account the sessions yet... But it's totally achievable as on copy trading I see there are multiple bot driven account with good returns and safe /stable.. There are some with perfect Winrate but they eventually washout.

    • @thinketh2408
      @thinketh2408 4 месяца назад +1

      @@CodeTradingCafe it was good time to invest last year mid... Not now... I missed by the way... Or I could have made 2x in 6 month easily... On eth and btc alone..

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      I invested in the good times 2 years ago, but got greedy and kept the money in while the crypto crash was obvious.

    • @thinketh2408
      @thinketh2408 4 месяца назад

      @@CodeTradingCafe that's why I like futures... No need to wait years.. For nominal profits... 😅

  • @bhavyamehra6931
    @bhavyamehra6931 4 месяца назад +1

    interesting

  • @famin2
    @famin2 4 месяца назад +1

    I do know Python nothing. How do I do Live Trading Bot Strategy In Python. I would appreciate your advise.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, you can still trade this strategy manually we did a backtest in the previous video ruclips.net/video/C3bh6Y4LpGs/видео.html

  • @nguyenduyta7136
    @nguyenduyta7136 25 дней назад

    Can I use api of ICMarkets?

    • @CodeTradingCafe
      @CodeTradingCafe  24 дня назад +1

      Yes you can, check their documentation and few examples you can translate this code to ICM

  • @darkrealm2371
    @darkrealm2371 4 месяца назад +4

    You should give the links of the best worked strategies so that you may gain more views and audience may get more better strategies

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +2

      Hi, thank you, maybe I already slipped some hints ... in previous videos ;)

  • @sankyuubigan
    @sankyuubigan 4 месяца назад +1

    why this strategy ? it is one of the most random and unprofitable. did you take it for live trading ?

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Hi, I find it simple and profitable, why not leveraging noise with BB and trend with EMAs.

    • @sankyuubigan
      @sankyuubigan 4 месяца назад +1

      @@CodeTradingCafe I'm doing the same thing with the same code, but I have no profit. and the tests are all negative. i don't understand what i'm doing wrong....

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      That's weird, actually wait for the next 2 vids I am recording now, I updated some details I will republish the updated version. Hang in there :)

  • @AlgotradingGr
    @AlgotradingGr 4 месяца назад +1

    @CodeTradingCafe add a smart dca logic to it and it will be even better without loses,split the dca in a smart way for the worst case scenario and you will never lose

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thinking about it ... figuring out what would be the best/safest way.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад

      Thanks a lot for your comments, I will try this out see if it's worth more research time.

    • @AlgotradingGr
      @AlgotradingGr 4 месяца назад

      @@CodeTradingCafe it is,my bot is making gains like this,when you try im waiting to see your results

  • @deepanshuaggarwal8550
    @deepanshuaggarwal8550 4 месяца назад +1

    It would be great if you provide your email or linkedIn. I am a data scientist and I want to ask 1-2 questions from you.

    • @CodeTradingCafe
      @CodeTradingCafe  4 месяца назад +1

      Hi, thank you for your support, my email is in the about section of this channel codingntrading gmail com