Reader small image

You're reading from  Python Algorithmic Trading Cookbook

Product typeBook
Published inAug 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838989354
Edition1st Edition
Languages
Right arrow
Author (1)
Pushpak Dagade
Pushpak Dagade
author image
Pushpak Dagade

Pushpak Dagade is working in the area of algorithmic trading with Python for more than 3 years. He is a co-founder and CEO of AlgoBulls, an algorithmic trading platform.
Read more about Pushpak Dagade

Right arrow

The last traded time of a financial instrument

The last traded time (LTT) of a financial instrument is the latest time at which an order was executed for that instrument. This data is dynamic in nature as it may change continuously during the live trading hours. This recipe helps fetch the LTT of a financial instrument.

Getting ready

Make sure the broker_connection and instrument1 objects are available in your Python namespace. Refer to the Technical requirements section of this chapter to set up broker_connection. Refer to the Attributes of a financial instrument recipe of this chapter to set up instrument1.

How to do it…

Fetch and print the LTT of instrument1:

>>> ltt = broker_connection.get_ltt(instrument1)
>>> print(f'Last traded time: {ltt}')

We get the following output (your output may differ):

Last traded time: 2020-07-17 14:42:54

How it works…

The get_ltt() method of the BrokerConnectionZerodha class fetches the LTT of the given financial...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Python Algorithmic Trading Cookbook
Published in: Aug 2020Publisher: PacktISBN-13: 9781838989354

Author (1)

author image
Pushpak Dagade

Pushpak Dagade is working in the area of algorithmic trading with Python for more than 3 years. He is a co-founder and CEO of AlgoBulls, an algorithmic trading platform.
Read more about Pushpak Dagade