
from AlgoAPI import AlgoAPIUtil, AlgoAPI_Backtest class AlgoEvent: def __init__(self): pass def start(self, mEvt): self.evt = AlgoAPI_Backtest.AlgoEvtHandler(self, mEvt) self.evt.start() def on_marketdatafeed(self, md, ab): self.evt.consoleLog(vars(md))
[2022-01-16 00:00:00] {'instrument': 'WTIUSD', 'timestamp': datetime.datetime(2022, 1, 16, 0, 0), 'askPrice': 84.409, 'bidPrice': 84.379, 'midPrice': 84.394, 'openPrice': 81.858, 'highPrice': 84.481, 'lowPrice': 81.166, 'lastPrice': 84.394, 'volume': 19084.0, 'bidSize': 1, 'askSize': 1, 'bidOrderBook': [], 'askOrderBook': [], 'producttype': 'SPOT', 'minTick': 0.001, 'expiry': '', 'strike': 0, 'right': '', 'symbol': 'WTIUSD', 'underlyingBid': -1, 'underlyingAsk': -1, 'greeks': {}, 'market': 'ENERGY', 'session': 0}
[2022-01-17
00:00:00] {'instrument': 'WTIUSD', 'timestamp': datetime.datetime(2022, 1, 17,
0, 0), 'askPrice': 84.355, 'bidPrice': 84.325, 'midPrice': 84.34, 'openPrice':
84.34, 'highPrice': 84.34, 'lowPrice': 84.34, 'lastPrice': 84.34, 'volume':
1.0, 'bidSize': 1, 'askSize': 1, 'bidOrderBook': [], 'askOrderBook': [],
'producttype': 'SPOT', 'minTick': 0.001, 'expiry': '', 'strike': 0, 'right':
'', 'symbol': 'WTIUSD', 'underlyingBid': -1, 'underlyingAsk': -1, 'greeks': {},
'market': 'ENERGY', 'session': 0}
[2022-01-18 00:00:00] {'instrument': 'WTIUSD', 'timestamp':
datetime.datetime(2022, 1, 18, 0, 0), 'askPrice': 84.355, 'bidPrice': 84.32,
'midPrice': 84.3375, 'openPrice': 84.394, 'highPrice': 84.623, 'lowPrice':
82.959, 'lastPrice': 84.3375, 'volume': 15793.0, 'bidSize': 1, 'askSize': 1,
'bidOrderBook': [], 'askOrderBook': [], 'producttype': 'SPOT', 'minTick':
0.001, 'expiry': '', 'strike': 0, 'right': '', 'symbol': 'WTIUSD',
'underlyingBid': -1, 'underlyingAsk': -1, 'greeks': {}, 'market': 'ENERGY', 'session':
0}
Original Posted by - Bella:What's your backtest setup?Just tried on 1-day dataset, 2022-01-17 data is available.from AlgoAPI import AlgoAPIUtil, AlgoAPI_Backtest class AlgoEvent: def __init__(self): pass def start(self, mEvt): self.evt = AlgoAPI_Backtest.AlgoEvtHandler(self, mEvt) self.evt.start() def on_marketdatafeed(self, md, ab): self.evt.consoleLog(vars(md))[2022-01-16 00:00:00] {'instrument': 'WTIUSD', 'timestamp': datetime.datetime(2022, 1, 16, 0, 0), 'askPrice': 84.409, 'bidPrice': 84.379, 'midPrice': 84.394, 'openPrice': 81.858, 'highPrice': 84.481, 'lowPrice': 81.166, 'lastPrice': 84.394, 'volume': 19084.0, 'bidSize': 1, 'askSize': 1, 'bidOrderBook': [], 'askOrderBook': [], 'producttype': 'SPOT', 'minTick': 0.001, 'expiry': '', 'strike': 0, 'right': '', 'symbol': 'WTIUSD', 'underlyingBid': -1, 'underlyingAsk': -1, 'greeks': {}, 'market': 'ENERGY', 'session': 0}
[2022-01-17 00:00:00] {'instrument': 'WTIUSD', 'timestamp': datetime.datetime(2022, 1, 17, 0, 0), 'askPrice': 84.355, 'bidPrice': 84.325, 'midPrice': 84.34, 'openPrice': 84.34, 'highPrice': 84.34, 'lowPrice': 84.34, 'lastPrice': 84.34, 'volume': 1.0, 'bidSize': 1, 'askSize': 1, 'bidOrderBook': [], 'askOrderBook': [], 'producttype': 'SPOT', 'minTick': 0.001, 'expiry': '', 'strike': 0, 'right': '', 'symbol': 'WTIUSD', 'underlyingBid': -1, 'underlyingAsk': -1, 'greeks': {}, 'market': 'ENERGY', 'session': 0}
[2022-01-18 00:00:00] {'instrument': 'WTIUSD', 'timestamp': datetime.datetime(2022, 1, 18, 0, 0), 'askPrice': 84.355, 'bidPrice': 84.32, 'midPrice': 84.3375, 'openPrice': 84.394, 'highPrice': 84.623, 'lowPrice': 82.959, 'lastPrice': 84.3375, 'volume': 15793.0, 'bidSize': 1, 'askSize': 1, 'bidOrderBook': [], 'askOrderBook': [], 'producttype': 'SPOT', 'minTick': 0.001, 'expiry': '', 'strike': 0, 'right': '', 'symbol': 'WTIUSD', 'underlyingBid': -1, 'underlyingAsk': -1, 'greeks': {}, 'market': 'ENERGY', 'session': 0}