# Add your decisions in on_bar. self.context.api places orders (buy, sell, place_order,
# close_position); self.context.indicators reads the engine's indicators (rsi, sma, ema,
# macd, call("ADX", period=14)); self.context.logger writes to the strategy log.
from xtester import Strategy, OrderSide, OrderType


class UserStrategy(Strategy):
    # symbol_key: exchange, market, symbol, timeframe of the closed bar.
    # bar: open_time, close_time, open, high, low, close, volume as Decimal.
    def on_init(self, context):
        context.logger.info("UserStrategy initialized.")

    def on_tick(self, price):
        pass

    def on_bar(self, symbol_key, bar):
        pass

    def on_finish(self, context):
        pass


def create_strategy():
    return UserStrategy()