📜  NseTools – 获得公司的临时利润

📅  最后修改于: 2022-05-13 01:54:30.098000             🧑  作者: Mango

NseTools – 获得公司的临时利润

在本文中,我们将了解如何使用 nsetools 获得给定公司的临时保证金。 Nsetools是一个用于从印度国家证券交易所收集实时数据的库。股票报价是在交易所报价的股票价格。特定股票的基本报价提供信息,例如其买入价和卖出价、最后交易价格和交易量。联交所根据风险观点从持有过大未平仓头寸的会员收取的临时保证金或基于波动性脚本征收的保证金。

下面是实现

Python3
# importing nse from nse tools
from nsetools import Nse
 
# creating a Nse object
nse = Nse()
 
# nse stock code for wipro
code = "wipro"
 
# getting stock quote
quote = nse.get_quote(code)
 
# getting adhoc margin
value = quote['adhocMargin']
 
# printing adhoc margin
print("Adhoc Margin  : " + str(value))


Python3
# importing nse from nse tools
from nsetools import Nse
 
# creating a Nse object
nse = Nse()
 
# nse stock code for sbi
code = "sbin"
 
# getting stock quote
quote = nse.get_quote(code)
 
# getting adhoc margin
value = quote['adhocMargin']
 
# printing adhoc margin
print("Adhoc Margin  : " + str(value))


输出 :

Adhoc Margin  : None

另一个例子

Python3

# importing nse from nse tools
from nsetools import Nse
 
# creating a Nse object
nse = Nse()
 
# nse stock code for sbi
code = "sbin"
 
# getting stock quote
quote = nse.get_quote(code)
 
# getting adhoc margin
value = quote['adhocMargin']
 
# printing adhoc margin
print("Adhoc Margin  : " + str(value))

输出 :

Adhoc Margin  : 13.02