import pdb
import time
import datetime
import traceback
import talib
from Dhan_Tradehull_V2 import Tradehull
import pandas as pd
Initialize Tradehull with client_code and token_id
client_code = “********”
token_id = “**********”
tsl = Tradehull(client_code, token_id)
After this i want to take one symbol and add the super trend indicator and Dhan open interest indicator. How can i do that?
hi did u get any help on this ?
Thanks for the reply.
I found my self how to apply the super trend indicator. But I didn’t know how to apply the OI indicator. At precent I’m working on it.
can you share your code once i will look into it & will try to help u if i can!! here main problem is tradehull v2 will have updates in further so this setup will need to auto adjust for all updates in future i guess after this nov20 there will be much changes in algo
I contact the Imran sir he gave me this code as ref.
Conditions that are on 5 minute timeframe
chart_5 = tsl.get_intraday_data(stock_name, ‘NSE’, 5) # 5 minute chart
chart_5 = tsl.get_historical_data(tradingsymbol = stock_name,exchange = ‘NSE’,timeframe=“5”) # this call has been updated to get_historical_data call,
indi = ta.supertrend(chart_5[‘high’], chart_5[‘low’], chart_5[‘close’], 7, 3)
chart_5 = pd.concat([chart_5, indi], axis=1, join=‘inner’)
cc_5 = chart_5.iloc[-1]
ub_breakout = cc_5[‘close’] > cc_5[‘SUPERTd_7_3.0’]
lb_breakout = cc_5[‘close’] < cc_5[‘SUPERTd_7_3.0’]
--------------- Logical reference --------------------------
import pandas_ta as ta
indi = ta.supertrend(df[‘high’], df[‘low’], df[‘close’], 7, 3)
df = pd.concat([df, indi], axis=1, join=‘inner’)
print(df)
‘Column1 = this will give full supertrend line values’ trend
‘Column2 = this will show if st is red or green’ direction
‘Column3 = show values only for green nan for red’ long
‘Column4 = show values only for red nan for green’ short
Use it for your use case and one thing if you know about how to apply the Dhan OI on a chart in python can you please let me know!!
sure thank you for letting me know it