question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How get tick data again

See original GitHub issue

In my code first i get current ltp of subscribed stock then i place buy order when my strategy applied, then i need tick data again for check current ltp for placing sell order. but when i call on_ticks(ws, ticks) function am getting below error. so kindly help me how get current ltp from outside of on_tick function.

on_ticks(ws, ticks) builtins.NameError: name 'ws' is not defined

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
vijaykzcommented, Aug 5, 2020

threaded_ticker.py is simple example on setting up tickers. on_ticks will continuously provide ticks for the subscribed tokens.

Once you’ve initialized the web socket connection in the threaded mode, you can continuously receive market ticks. This is where you would implement your strategy.

1reaction
vijaykzcommented, Aug 5, 2020

on_ticks is a callback: you don’t call it, it gets called by the web socket (ws) library.

Please check some examples on how to setup callbacks - https://github.com/zerodhatech/pykiteconnect/tree/master/examples. These should help you to setup live streaming of market ticks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tick History Data - Refinitiv
As you investigate our comprehensive database of 87 trillion+ ticks, spanning 100million + instruments across 500 global exchanges and dating back 25 years, ......
Read more >
How to Import Tick Data into Metatrader 5 for Back-Testing
How to Import Tick Data into Metatrader 5 for Back-Testing · 1. Select the date range that you wish to test. · 2....
Read more >
Tick History Services | ICE
Our comprehensive suite of raw market data and normalized tick history services provide the historical data required for informed decision making. ICE DataVault....
Read more >
99% Backtesting on MT4 with the new Tick Data Suite v2
The Ultimate MT4 Backtesting Guidehttps://www.mt4backtest.com/This video shows how to use the new Tick Data Suite 2 on MetaTrader 4 trading ...
Read more >
11.2) Understanding Tick Data, M1 OHLC, and ... - YouTube
... traders using the MetaTrader Strategy Tester to fully understand the Tick, M1 OHLC, and Open Prices Models. Get this wrong and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found