The error I am getting

Runtime Error: TypeError : trade() takes 1 positional argument but 2 were given
at BearRebalance
self.trade({**self.HLD_IN in main.py: line 338 (Open Stacktrace)

Working through combining two separate algorithms and I seem to be running into an issue I believe is at the part that is checking whether the algorithm is already holding stocks:

  1. if not self.BE_IN:
  2. # Only trade when changing from in to out
  3. self.trade({**dict.fromkeys(self.HLD_IN, 0), **self.HLD_OUT})
  4. elif self.BE_IN:
  5. # Only trade when changing from out to in
  6. self.trade({**self.HLD_IN, **dict.fromkeys(self.HLD_OUT, 0)}

 

Can anyone point me in the right direction here?

 

 

Author

Axist

January 2022