Hello, I am now studying to be aware of Algogene's backtesting engine.
I run this code and the result shows this result.
<CODE>
class AlgoEvent:
def __init__(self):
self.timer = datetime(1970, 1, 1)
self.rsi_period = 14
self.instrument = ""
def start(self, mEvt):
self.instrument = mEvt["subscribeList"][0]
self.evt = AlgoAPI_Backtest.AlgoEvtHandler(self, mEvt)
self.evt.start()
def on_bulkdatafeed(self, isSync, bd, ab):
pass
def on_marketdatafeed(self, md, ab):
if md.timestamp >= self.timer + timedelta(hours=24):
#Update timeer
self.timer = md.timestamp
#get last 14 closing price
res = self.evt.getHistoricalBar({"instrument":self.instrument}, self.rsi_period+1, "D")
self.evt.consoleLog("historical bar = ", res)
<RESULT>
One of the results is:
('2019-01-01 00:00:00', {'t': '2019-01-01 00:00:00', 'o': 3591.4, 'h': 3960.6, 'l': 3576.0, 'c': 3835.4, 'b': 3810.4, 'a': 3860.4, 'm': 3835.4, 'v': 8452.0, 'instrument': 'BTCUSD', 'expiry': '', 'right': '', 'strike': 0, 'symbol': 'BTCUSD', 'bb': [], 'ab': []})])
So, it shows that the open price of BTCUSD was 3591.4 on 2019-01-01. However, I think the actual data is not equal to the result. In this engine, isn't it based on actual data? Or if there are errors in my code, please let me know.
Thank you in advance for your help and good luck with the competition!