Learn Algo Trading with Python | Codes | Youtube Series

Hi @rahulcse56

from which url did you extract this list from

Yes, Please…

please help

1 Like

Hi @vinay_kumaar
I also need to check the main code to see what has gone wrong,
but on high level I think order was not sent to dhan platform,
or the api returned wrong value

se send code also.

Hi, did you find the solution? am also getting same error

I think you are trying to place your order after market time

Yes sir

Sir please arrange a video for option chain data calling by python and most oi volume strikes call by python

This is solved, I was using bad token

Hi @thakurmhn

The error says Client ID or Token invalid
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’}}

check if the client id given is correct and the token given is correct.

@Tradehull_Imran Sir please understand i am doing this on my office pc and SSL certificate issue arrives using yours script and Google colab and Amazon doesn’t worked out either.
That’s why i am using this api directly…like you have created your own.
Everything works but only placing the order in options fails.
Please help me .

Hi @Hitesh_Maurya

Okey, I am checking on it

in the meantime, can you fix the ssl issue you are facing
apply point 3 Update Certificates from this link : Learn Algo Trading with Python | Codes | Youtube Series - #177 by Tradehull_Imran

and use the exiting code with tsl
tsl.order_placement(ce_name, 'NFO', lot_size, 0, 0, 'MARKET', 'BUY', 'MIS')

most probably it will work, if now we will go direct with dhan.place_order()

let me know the update after you attempt it

1 Like

Hi @Tradehull_Imran , after changing the trading and data API codes I am getting the below errors while runnign the scripts . Please suggest the fix.

-----Logged into Dhan-----
reading existing file all_instrument 2024-11-28.csv
Got the instrument file
2024-11-28 11:14:51,051 - ERROR - Token validation failed: ‘Tradehull’ object has no attribute ‘validate_token’

D:\Python_Project\Working Directory>

Hi @Samis
send you code folder in a google drive link.
remove confidential info from codes

shared the file. please check and suggest

Hi @babji3 @vinay_kumaar

remove exiting Dhan_Tradehull_V2 and use this file instead,
try order placement and send complete error and code if it fails

file : Dhan_Tradehull_V2.py - Google Drive

Hi @Hitesh_Maurya

use this code


order = tsl.Dhan.place_order(security_id='42948', exchange_segment='NSE_FNO',transaction_type='SELL', quantity=25, order_type='MARKET', product_type='INTRADAY', price=0)
# security_id "42948" is for "NIFTY 28 NOV 24000 CALL"

1 Like

Hi @Samis

file not found

do send code on forum : Learn Algo Trading with Python | Codes | Youtube Series - #368 by Tradehull_Imran

sir @Tradehull_Imran issue is fixed. thanks for your support.

1 Like

Hi @thakurmhn
also for windows, do upgrade to 2.0.0