For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Some trades not executing while others are



  • I have tried increasing cash and leverage but still I can't get all the trades to get executed. Here is a sample of my entry logic. It's is a simple rsi overbought and oversold strategy , number of trades are supposed to be at least 30 but i get only 8 executed trades,```

    def init(self):
    self.dataclose = self.data.close
    self.trade_tracker = []
    # Rsi
    self.rsi = btind.RSI(self.datas[0], period = 10)
    self.rsi_of_rsi = btind.RSI(self.rsi, period = 3)
    self.bar_executed = 0

    # william %r
    self.willr = btind.WilliamsR(self.datas[0],period = 30 )
    self.ma_willr = btind.SimpleMovingAverage(self.willr, period = 8)
    self.ma_willr.plotinfo.plotmaster = self.willr
    self.willr_sigs = btind.CrossOver(self.ma_willr, self.willr)
    
    self.ema_of_rsi = btind.SimpleMovingAverage(self.rsi, period = 10)
    self.ema = btind.SimpleMovingAverage(self.datas[0], period = 20)
    self.rsi_of_rsi.plotinfo.plotmaster = self.rsi
    self.buy_sigs = btind.CrossOver(self.rsi, 20)
    self.sell_sigs = btind.CrossDown(self.rsi, 70)
    

    def next(self):
    self.dt = self.data.datetime.datetime()
    if not self.position:
    if self.buy_sigs[0] :
    self.cash_before = self.broker.getcash()
    value = self.broker.get_value()
    entry = self.buy(size = self.params.size)
    entry.addinfo(name = 'buy')
    self.log('Buy Create %.4f,' % self.dataclose[0])

      elif self.sell_sigs[0]:
        value = self.broker.get_value()
        entry = self.sell(size = self.params.size)
        entry.addinfo(name = 'sell')
        self.log('sell Create %.4f' % self.dataclose[0])
      else:
        pass
    
    else:
    

Log in to reply
 

});