@Tradehull_Imran Sir
I Ran That Py File In Vs Codes Terminal So
1st Ishue Is Look The Image That Trancebook Ishue How I Can Solve It
2nd Is That File Is Running Currectly Or Not
@Tradehull_Imran Sir Please Guide Me
@Tradehull_Imran Sir
I Ran That Py File In Vs Codes Terminal So
1st Ishue Is Look The Image That Trancebook Ishue How I Can Solve It
2nd Is That File Is Running Currectly Or Not
@Tradehull_Imran Sir Please Guide Me
Very Good Morning Sir,
I am getting the following error, while executing install libraries.bat from session 2 folder. As you have suggested me to install talib by using this particular file from Session 2 folder.
CMD Error:
Requirement already satisfied: packaging>=23.1 in c:\users\rp\appdata\local\programs\python\python38\lib\site-packages (from chromedriver-autoinstaller) (24.1)
WARNING: Requirement âC:\Users\RP\Desktop\DHAN Algorhythemic Trading\Session2\Installation\Twisted-20.3.0-cp38-cp38-win_amd64.whlâ looks like a filename, but the file does not exist
Processing c:\users\rp\desktop\dhan algorhythemic trading\session2\installation\twisted-20.3.0-cp38-cp38-win_amd64.whl
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: âC:\Users\RP\Desktop\DHAN Algorhythemic Trading\Session2\Installation\Twisted-20.3.0-cp38-cp38-win_amd64.whlâ
WARNING: Requirement âC:\Users\RP\Desktop\DHAN Algorhythemic Trading\Session2\Installation\TA_Lib-0.4.24-cp38-cp38-win_amd64.whlâ looks like a filename, but the file does not exist
Processing c:\users\rp\desktop\dhan algorhythemic trading\session2\installation\ta_lib-0.4.24-cp38-cp38-win_amd64.whl
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: âC:\Users\RP\Desktop\DHAN Algorhythemic Trading\Session2\Installation\TA_Lib-0.4.24-cp38-cp38-win_amd64.whlâ
Press any key to continue . . .
Guide me sir.
Hi
@Tradehull_Imran
There is no NRML order works onli MIS works
So please remove the error
C:\Algo Practice\Trading>py âFuture BankNifty.pyâ
Codebase Version 2.1
-----Logged into Dhan-----
reading existing file all_instrument 2024-12-24.csv
Got the instrument file
BUY BANKNIFTY DEC FUT 09:39:53.334306 False True False True TrueTrue cc_1 2024-12-24 09:30:00+05:30
SELL BANKNIFTY DEC FUT 09:39:53.334306 True True True True TrueTrue cc_1 2024-12-24 09:30:00+05:30
lot_size = 15 #tsl.get_lot_size(index_name)*1
trade_info[âindex_nameâ] = index_name
trade_info[âentry_orderidâ]= tsl.order_placement(trade_info[âindex_nameâ],âNFOâ, lot_size, 0, 0, âMARKETâ, âSELLâ, âNRMLâ)
time.sleep(1)
trade_info[âentry_priceâ]= tsl.get_executed_price(orderid=trade_info[âentry_orderidâ])
traded = âyesâ
trade_info[âqtyâ] = lot_size
trade_info[âslâ] = round((trade_info[âentry_priceâ]+130),1)
traded_wathclist.append(index_name)
Hi @CHETAN_99
I am bit unclear on the question,
but on high level the code seems to be working fine
error :
No such file or directory: âC:\Users\RP\Desktop\DHAN Algorhythemic Trading\Session2\Installation\TA_Lib-0.4.24-cp38-cp38-win_amd64.whlâ
most probably TA_Lib-0.4.24-cp38-cp38-win_amd64.whl and Twisted-20.3.0-cp38-cp38-win_amd64.whl are not in the same folder where install libraries.bat is kept
they all should be in same folder
use below code ,
entry_orderid = tsl.order_placement(tradingsymbol='NIFTY 26 DEC 23950 CALL' ,exchange='NFO', quantity=100, price=0, trigger_price=0, order_type='MARKET', transaction_type='BUY', trade_type='CNC')
sir i wanted to say how i can solve this following problem
-----Logged into Dhan-----
This BOT Is Picking New File From Dhan
Got the instrument file
2024-12-24 10:39:39,935 - ERROR - Error processing GMRINFRA: No expiry date found for GMRINFRA
Traceback (most recent call last):
File âC:\Users\Chetan More\AppData\Local\Programs\Python\Python38\lib\site-packages\Dhan_Tradehull\Dhan_Tradehull.pyâ, line 128, in correct_step_df_creation
raise ValueError(f"No expiry date found for {name}")
ValueError: No expiry date found for GMRINFRA
We have now updated thew file for quote data
use : Dhan_Tradehull_V2.py - Google Drive
example usage
quote_data = tsl.get_quote(names = ['NIFTY 26 DEC 23950 CALL'])
pprint(quote_data)
response received
{'NIFTY 26 DEC 23950 CALL': {'average_price': 39.34,
'buy_quantity': 445075,
'depth': {'buy': [{'orders': 1,
'price': 45.4,
'quantity': 50},
{'orders': 1,
'price': 45.35,
'quantity': 150},
{'orders': 14,
'price': 45.3,
'quantity': 2400},
{'orders': 20,
'price': 45.25,
'quantity': 3400},
{'orders': 15,
'quantity': 2025}],
'sell': [{'orders': 4,
'price': 45.45,
'quantity': 900},
{'orders': 21,
'price': 45.5,
'quantity': 3500},
{'orders': 20,
'price': 45.55,
'quantity': 3250},
{'orders': 17,
'price': 45.6,
'quantity': 3075},
{'orders': 10,
'price': 45.65,
'quantity': 2100}]},
'last_price': 45.45,
'last_quantity': 125,
'last_trade_time': '24/12/2024 11:07:10',
'lower_circuit_limit': 0.05,
'net_change': 8.5,
'ohlc': {'close': 36.95,
'high': 58,
'low': 20.7,
'open': 28.95},
'oi': 2948375,
'oi_day_high': 2969750,
'oi_day_low': 2506300,
'sell_quantity': 451975,
'upper_circuit_limit': 416.4,
'volume': 28113725}}
@Tradehull_Imran Is there an option to filter the instrument file. It has around 1.8L rows and donât trade those. Its an extra overload for the script. Is it possible to optimise it?
instrument file is used by the codebase, also its a one time read at the initialization.
Yes, the file is bit heavy but I think its still not a bottleneck to performance.
âPremature optimization is the root of all evil.â - Donald Knuth
Yes sir, This above mentioned file is there in the Session 2 folder sir. Please check sir.
VBR Prasad
Do try the installation and share the screen recording of the same.
share the file to : tradehull_mentorship@tradehull.com
Respected Imran Sir, We would be greatfull to you, if you can post the Video clip of the Mumbai Meet. Thank you sir.
VBR Prasad
Okay sir. Thank you very much
Sir, I was trying to execute Combined premium file in API Upgrade folder.
Following is the code and error details.
CODE:`import pdb
import time
import datetime
import traceback
from Dhan_Tradehull_V2 import Tradehull
import pandas as pd
from pprint import pprint
import talib
import time
client_code = â1101092420â
token_id = âeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJkaGFuIiwicGFydG5lcklkIjoiIiwiZXhwIjoxNzM0NjA4ODc1LCJ0b2tlbkNvbnN1bWVyVHlwZSI6IlNFTEYiLCJ3ZWJob29rVXJsIjoiIiwiZGhhbkNsaWVudElkIjoiMTEwMTA5MjQyMCJ9.TfMDBHpTlWqlfJ0dC-28fyLUuLC0Q_239Y6IYAuEkfZqZvgZns_PI3lk1HnOdmo6gvTwrhDAn3tLv4oZ0u-T5Qâ
tsl = Tradehull(client_code,token_id)
call_list = [âNIFTY 26 DEC 23800 CALLâ, âNIFTY 26 DEC 23800 PUTâ]
while True:
current_time = datetime.datetime.now()
ltp_data = tsl.get_ltp_data(names = call_list)
ce_ltp = ltp_data[âNIFTY 26 DEC 23800 CALLâ]
pe_ltp = ltp_data[âNIFTY 26 DEC 23800 PUTâ]
atm_combined_premium = ce_ltp + pe_ltp
print(current_time, atm_combined_premium)
time.sleep(0.5)
ERROR:
C:\Users\LENOVO PC\Desktop\RP\DHAN Algorhythemic Trading\1. Api Upgrade>py â1.2 combined premium.pyâ
Codebase Version 2.3 : Solved - ATM issues
-----Logged into Dhan-----
reading existing file all_instrument 2024-12-24.csv
Got the instrument file
Exception at calling ltp as {âstatusâ: âfailureâ, âremarksâ: {âerror_codeâ: None, âerror_typeâ: None, âerror_messageâ: None}, âdataâ: {âdataâ: {â808â: âAuthentication Failed - Client ID or Token invalidâ}, âstatusâ: âfailedâ}}
Traceback (most recent call last):
File â1.2 combined premium.pyâ, line 33, in
ce_ltp = ltp_data[âNIFTY 26 DEC 23800 CALLâ]
KeyError: âNIFTY 26 DEC 23800 CALLâ`
Sorry sir, I forgot to update the token_id, now the combined premium file is functional sir.
Thank you
VBR Prasad
Hello Sir,
Did you check the same. Every time I am getting live_pnl as 0. Also those exceptions as well.
regards
Thanks. you have pdb set in get_quote function. please comment it out.
Hi @Vasili_Prasad
Error says
Exception at calling ltp as {âstatusâ: âfailureâ, âremarksâ: {âerror_codeâ: None, âerror_typeâ: None, âerror_messageâ: None}, âdataâ: {âdataâ: {â808â: âAuthentication Failed - Client ID or Token invalidâ}, âstatusâ: âfailedâ}}
Hi @balrajsingh
if the position book is empty the function will return 0, because no position has been created as of now.