J
@admin I connected using websocket.
let { SmartAPI, WebSocket } = require("smartapi-javascript");
let web_socket = new WebSocket({
client_code: "P529774",
feed_token: "097948399"
});
web_socket.connect()
.then(() => {
web_socket.runScript("nse_cm|2885", "cn")// SCRIPT: nse_cm|2885, mcx_fo|222900 TASK: mw|sfi|dp
web_socket.runScript("nse_cm|2885", "mw")
setTimeout(function() {
web_socket.close()
}, 3000)
})
web_socket.on('tick', receiveTick)
function receiveTick(data) {
console.log("receiveTick:::::", data)
}
But I am getting the following response.
receiveTick::::: [ { ak: 'ok', task: 'cn', msg: 'connected' } ]
receiveTick::::: []
receiveTick::::: [ { tvalue: '07/12/2021 16:19:25', name: 'tm' } ]
receiveTick::::: [ { tvalue: '07/12/2021 16:19:26', name: 'tm' } ]
receiveTick::::: [ { tvalue: '07/12/2021 16:19:27', name: 'tm' } ]
Socket closed
will it send response during market hours only?