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.data.Spread[-1]
current_signal = self.data.Signal[-1]
# Calculate bid and ask prices using the spread in points
bid_price = current_price - (current_spread * 0.001 / 2)
ask_price = current_price + (current_spread * 0.001 / 2)
if current_signal == 1:
self.buy()
if current_signal == -1:
self.sell()
how can I implement the ask and bid here the only arguments in self.buy and self.sell is
def sell(self, *, size=.9999, limit=None, stop=None, sl=None, tp=None)
def buy(self, *, size=.9999, limit=None, stop=None, sl=None, tp=None)