Backtesting.py SMA Crossover Strategy Example with Bitcoin: Using Python to Optimize Parameters

Поділитися
Вставка
  • Опубліковано 6 лют 2025

КОМЕНТАРІ • 19

  • @kitefrog
    @kitefrog 2 роки тому

    You should post links for getting your code, like most do?

  • @hourglass9
    @hourglass9 2 роки тому

    Great Video! Can you simultaneously do a backtesting on all 4 symbols
    like for example EURUSD and SPUSD
    so if I buy on SP500 on 2011-01-07 and sell on 2011-01- 10 then in the next buy this program will recheck the opportunity in EURUSD and SPUSD and automatically matches the buying signal and then buy that stock after 2011-01-10
    in this way we can have a full return on investment
    😀

  • @borism4849
    @borism4849 2 роки тому

    How to make sure that Buy & Hold Return strategy and your strategy start at the same time?

    • @thetradingmuse1384
      @thetradingmuse1384  2 роки тому

      You set the start and end date for the data, and use the same data set for both strategies.

    • @borism4849
      @borism4849 2 роки тому

      @@thetradingmuse1384 Yes but if the strategy implies moving averages with n period, the strategy will start at n period after the start date. The buy and hold strategy will start at the start date. That's a problem.

  • @kawaiimonica716
    @kawaiimonica716 2 роки тому

    This is using small data, what do I do if I want to load large data(10gb) in chunks?

  • @yuanfanglu
    @yuanfanglu 3 роки тому

    I noticed that if you have a position and meets the buy criteria again, the system will sell off the current position first (decided by system) and buy again. Is the observation of the behavior correct?

    • @thetradingmuse1384
      @thetradingmuse1384  3 роки тому

      In this strategy if SMA(short) crosses over SMA(long) then a buy signal is produced. This does not happen again unless the reverse happens first, SMA(long) crosses over SMA(short). So because you cannot get a buy signal when you already bought, the system keeps the position until the sell signal is produced, SMA(long) crosses over SMA(short).

  • @marcogelsomini7655
    @marcogelsomini7655 3 роки тому

    Nice!! I don't get what do you store in heatmap variable at line 51? What is that \ at the end? I am new in python

    • @thetradingmuse1384
      @thetradingmuse1384  3 роки тому

      Heatmap stores the heatmap, the calculated values for different combinations of the parameters. \ just means the statement continues on the following line.

  • @mehmetcanaksoy8217
    @mehmetcanaksoy8217 3 роки тому

    Merhaba python ile bot kodlama ve bactest yapabilmeyi profesyonel bir kanaldan öğrenmek istiyorum udemy üzerinden vs öneride bulunabilir misiniz?

    • @thetradingmuse1384
      @thetradingmuse1384  3 роки тому

      udemy'de "python backtesting" diye aratırsanız birkaç ders çıkıyor. İnceleyebilirsiniz, ben kendim bakmadım.

    • @mehmetcanaksoy8217
      @mehmetcanaksoy8217 3 роки тому

      @@thetradingmuse1384 sizin bu şekilde bir eğitim seriniz olacak mı?

  • @mojtabahajilari
    @mojtabahajilari 3 роки тому

    How to use backtesting.py without talib?

    • @thetradingmuse1384
      @thetradingmuse1384  3 роки тому

      You may want to check out kernc.github.io/backtesting.py/ for the examples. You can use other libraries too, talib is written in C and is fast.

    • @mojtabahajilari
      @mojtabahajilari 3 роки тому

      @@thetradingmuse1384 The backtesting.py document is weak. There are a few examples.

  • @poofpoofgaming2866
    @poofpoofgaming2866 3 роки тому

    Turk musun aga? :) aksanin oyle gibi