Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
54 views

In backtesting.py, when looking at the trade statistics, the latest of field Last exit date is always filled with a date which is more recent than the latest date in field Last entry date. This means ...
Marc8932's user avatar
  • 131
1 vote
0 answers
54 views

I'm using backtesting.py package https://kernc.github.io/backtesting.py/ in the latest Anaconda distribution. The computation is finished successfully with right result. But it's not possible to show ...
Wenjie Yu's user avatar
  • 101
0 votes
0 answers
79 views

I am a vectorbt newbie. so far I have been successfully setup many parameters, but what I cannot find is a way of exiting the trade if the max number of bars is reached This is my current function: ...
adsjr's user avatar
  • 15
0 votes
1 answer
261 views

unable to get the reward part working Hi, I'm trying to calculate the profit price target based on the distance between entry price and recentlow, then times 3 to get 1 to 3 risk-reward setup working ...
BirdstudioNZ's user avatar
1 vote
0 answers
79 views

I have run two tests which clearly explain the scenario. Please see code block below of notify_order and notify_trade. **Test 1 (execute only 1 sellstop order): ** When I solely execute a sellstop ...
Pierre Cilliers's user avatar
0 votes
0 answers
37 views

Im just trying to run vectorbt to test out some of it's functions, in this case the rolling_sharpe, but I keep getting this error, does anyone know to solve this problem? File "/Users/datwiththed/...
Ngtn Datt's user avatar
0 votes
1 answer
210 views

I am trying to do stock backtesting in Google sheets. I have entered scrip symbol in A3, entry date in B3, the last date to exit the stock in C3 and the target price in D3. Now I want to find on which ...
nachiket jadhav's user avatar
0 votes
1 answer
62 views

I'm running the following code and getting this error - ChatGPT cannot solve this one. Please help. Here is the code: import pandas as pd import numpy as np import yfinance as yf import matplotlib....
user28102875's user avatar
0 votes
0 answers
71 views

I'm pretty new to programming and I am learning to code a backtest with data from Oanda API. When I plot the chart below, I get these gaps on weekends. I check the data and index(time) does not show ...
Han J's user avatar
  • 1
-1 votes
1 answer
302 views

I want to implement spread so I calculate the ask and bid price already class TestStrategy(Strategy): def next(self): current_price = self.data.Close[-1] current_spread = self....
fcnealvillangca's user avatar
0 votes
1 answer
151 views

I'm trying to make a back trading class. but I don't really get how spread works for example if you buy in 1.06649 how will spread works here? and in the same trade if I exit in my intended take ...
fcnealvillangca's user avatar
0 votes
1 answer
113 views

I'm facing some of the problem about adding custom data for strategy. Most of the case which I can search on Internet is the data contain OHLCV (which is the default by backtrader) But now my custom ...
AM_Star's user avatar
2 votes
0 answers
239 views

My goal is to backtest data where you provide buy/sell dates and closing prices to backtest module in order to backtest data from one source csv (instead of having 3 separate files such as price data, ...
MMsmithH's user avatar
  • 457
1 vote
1 answer
80 views

I'm trying to build my own EA using EMA. When the program starts it will buy/sell according to the relative position of slow and fast EMA. Then the program should close the trade at the next EMA ...
Haswellrefresh2's user avatar
-1 votes
1 answer
62 views

I have a number of csv files with stock data and i create a Pandas data frame with a for symbol in symbol list loop by providing the path and reading these files.. The data frame has each stock sub ...
andypappy's user avatar
1 vote
1 answer
475 views

I'm trying to load a custom data feed from a csv file that I've generated called "impact.csv" through the script below "backtrader_impact.py". However, at "cerebro.adddata(...
user23567225's user avatar
0 votes
1 answer
1k views

Good afternoon, can anyone tell my why the following strategy is not generating signals? The RSI part works fine but I have problems with the MACD. I tried the logic on a normal data frame, it worked ...
Felix's user avatar
  • 1
0 votes
1 answer
99 views

I've got pandas dataframe with candle highs and lows. I've made new column, which shows pivot points (if the value in cell is lowest\highest between two above it an two below it, it has value 1 for ...
Глеб Дубовенко's user avatar
0 votes
1 answer
368 views

Trying to get some idea on how to debug this. Just started to use backtesting.py + TA to conduct some backtesting. Seems to work for EMA indicator. RSI indicator did not work: Tried with self.rsi ...
kryfire's user avatar
  • 11
0 votes
1 answer
643 views

Backtest.run() Output: <bound method Backtest.run of <backtesting.backtesting.Backtest object at 0x0000022BAA3F79A0>> Backtest.plot() Output: <bound method Backtest.plot of <...
Cheng Jun Wei's user avatar
-1 votes
1 answer
288 views

I am trying to backtest a momentum strategy using Backtesting.py. I've gathered the data and computed indicator values using pandas_ta. I've defined short and long trading conditions. Now I just ...
so1120's user avatar
  • 275
3 votes
1 answer
770 views

'UserWarning: Some prices are larger than initial cash value. Note that fractional trading is not supported. If you want to trade Bitcoin, increase initial cash, or trade μBTC or satoshis instead (GH-...
Gdm_97's user avatar
  • 49
0 votes
0 answers
195 views

I'm presented with the following problem. I have time series data of prices and through the use of the "loc" method I was able to create a new column "trade" that stores the close ...
Gus's user avatar
  • 193
0 votes
1 answer
291 views

To learn how to use the Backtesting.py library I followed this YouTube video: https://youtu.be/9m987swadQU?si=6UN7ARnrYrN6u7nf But when I wrote my Strategy class: class MomentumStrategy(Strategy): ...
MateMalte's user avatar
0 votes
1 answer
735 views

I am trying to backtest a simple trading strategy using python3 using the backtesting module. Here is a sample of the data I am using through an external CSV: Date,Open,High,Low,Close,Volume 2023-08-...
Manash Dutta's user avatar

1
2 3 4 5 6