Skip to content

Commit

Permalink
Fix example backtest
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Aug 10, 2023
1 parent d76830d commit 659affa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def create_buy_order(self, last: QuoteTick) -> None:
self.log.error("No instrument loaded.")
return

price: Decimal = last.bid - (self.atr.value * self.atr_multiple)
price: Decimal = last.bid_price - (self.atr.value * self.atr_multiple)
order: LimitOrder = self.order_factory.limit(
instrument_id=self.instrument_id,
order_side=OrderSide.BUY,
Expand All @@ -318,7 +318,7 @@ def create_sell_order(self, last: QuoteTick) -> None:
self.log.error("No instrument loaded.")
return

price: Decimal = last.ask + (self.atr.value * self.atr_multiple)
price: Decimal = last.ask_price + (self.atr.value * self.atr_multiple)
order: LimitOrder = self.order_factory.limit(
instrument_id=self.instrument_id,
order_side=OrderSide.SELL,
Expand Down

0 comments on commit 659affa

Please sign in to comment.