kernc / backtesting.py

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.
https://kernc.github.io/backtesting.py/
GNU Affero General Public License v3.0
5.04k stars 987 forks source link

parallel trades #1130

Open dil200 opened 3 months ago

dil200 commented 3 months ago

find out what is the maximum parallel trades during back testing

class rsibuy(Strategy): def init(self):

def next(self):
    signal= self.data.RSI_Cross[-1]
    atr= self.data.ATR[-1]
    price=self.data.Close[-1]
    size=round(10/price)
    if signal:
        self.buy(size=size,tp=price+(atr_mlt* atr))