Hello community,
I just started my API access subscription and am working through the AutoTrade tutorial series, but I can’t seem to get the templates to even run.
I suspect it has something to do with a wrong or missing parameter being fed into the web socket, but I can’t trace it back to what the issue is. I have updated the REPLAY_TIMES inputs in the index file to something more recent, thinking that perhaps the default date/times were out of range, but that isn’t it.
Here is what I am getting:
[AutoTrade]: You chose NQH2 for parameter contract.
[AutoTrade]: You chose Tick for parameter barType.
[AutoTrade]: You chose 10 for parameter barInterval.
[AutoTrade]: You chose UnderlyingUnits for parameter elementSizeUnit.
[AutoTrade]: You chose true for parameter histogram.
[AutoTrade]: You chose asMuchAsElements for parameter timeRangeType.
[AutoTrade]: You chose 10 for parameter timeRangeValue.
Is this information correct?
[1.] Yes
[2.] No
{
contract: {
id: 2419021,
name: ‘NQH2’,
contractMaturityId: 44664,
status: ‘DefinitionChecked’,
providerTickSize: 0.25
},
barType: ‘Tick’,
barInterval: 10,
elementSizeUnit: ‘UnderlyingUnits’,
histogram: true,
timeRangeType: ‘asMuchAsElements’,
timeRangeValue: 10,
dev_mode: true,
replay_periods: [
{
start: ‘2021-12-26T23:00:00.000Z’,
stop: ‘2021-12-26T23:01:00.000Z’
},
{
start: ‘2021-12-26T23:02:00.000Z’,
stop: ‘2021-12-26T23:03:00.000Z’
}
]
}
./example-api-trading-strategy/websocket/TradovateSocket.js:53
this.ws.addEventListener(‘message’, resSubscription)
^
TypeError: Cannot read properties of null (reading ‘addEventListener’)
at ReplaySocket.TradovateSocket.request (./example-api-trading-strategy/websocket/TradovateSocket.js:53:13)
at ReplaySocket.checkReplaySession (./example-api-trading-strategy/websocket/ReplaySocket.js:11:17)
at new Strategy (./example-api-trading-strategy/strategies/strategy/strategy.js:67:38)
at new PriceDisplayStrategyFP (./example-api-trading-strategy/strategies/priceDisplayFP/priceDisplayStrategyFP.js:6:1)
at configureRobot (./example-api-trading-strategy/utils/configureRobot.js:67:30)
at async main (./example-api-trading-strategy/index.js:96:22)
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.
If anyone has any thoughts as to what my issue could be, I would appreciate it!