Why I am having many trades even if exclusive_orders=True #1036
Replies: 1 comment
-
I wasn't able to run your code; not sure what your data frame column As you can see from the
So in the first buy you bought 6 shares then sold 80% rounded to the nearest whole share (5 shares sold leaving 1) and then on the next trigger, you sold the last share you had. This then repeats for the next buy and next buy etc. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, i am backtesting an SMA strategy, i want to implement the following logic : It will be a buy only strategy, we trigger a buy signal if
crossover(self.sma1, self.sma2)
, ifcrossover(self.sma2, self.sma1)
I want to reduce my last position to 80%, i did that usingself.position.close(portion = 0.8)
, the problem is that i don't want many orders at the same time.Here is my code :
exclusive_orders =True, and i cannot understand why i am having sometimes two trades at same time.
Beta Was this translation helpful? Give feedback.
All reactions