Learn Algo Trading with Python | Codes | Youtube Series

Hi @Tradehull_Imran @RahulDeshpande,

Again today morning starting receiving errors.

Thank you sir. I will check it once again.

Thank you sir. I will try to check once again.

1 Like

Ohh, I am very sorry :pensive: @Tradehull_Imran sir.

If I had known 2-3 weeks earlier, I would definitely have joined and postponed my pre-scheduled plan. @Dhan is undoubtedly doing a great job, arranging surprises with valuable workshops. My only request is to inform us a bit earlier so we can join.

@RahulDeshpande, I saw your message and thought it was only for Mumbai people. I am currently staying in Hyderabad for job purposes, so attending would be easy for me. However, this Friday, I am traveling to my hometown and will be back on January 1st.

Last time, I also attended the offline workshop on very short notice.

2 Likes

Sir, I am trying to trace out the error.

In line no.28, In place of ‘chat’ , I think it should be ‘chart_index’

Is it correct or not sir?

VBR Prasad

Hi @Tradehull_Imran

I m facing an issue while placing order for sensex options

if i execute below codes its fires orders properly for Nifty options

> tsl.order_placement('NIFTY 19 DEC 23700 PUT', 'NFO', '25', 0, 0, 'MARKET', 'BUY', 'MIS')

but when I place order for sensex it gives error

> tsl.order_placement('SENSEX 20 DEC 81000 CALL', 'BFO', '10', 0, 0, 'MARKET', 'BUY', 'MIS')

Error:

File “d:\Dhan Algo\Practice\Dhan_Tradehull_V2.py”, line 139, in order_placement
orderid = order[“data”][“orderId”]
KeyError: ‘orderId’

Hello @Tradehull_Imran Sir
I am feeling very good you back :rose:
Error :point_down:

1 Like

I m from pune & will surely join, please let me know the timing & address…

can some one please help to create zigzag indicator with Deviation 5, Depth 10. in daily chart.

Algo stopped executing when the system goes to sleep. Logically, It shouldn’t be. ya? @Tradehull_Imran ?

Hi sir,
Please guide in the bactesting of algo

Rate limits issues still coming in Version 2.3

I would attend the offline workshop in Mumbai

2 Likes

Dear Sir,
I am unable to get live pnl in my Algo code>
I am using the mentioned command
live_pnl = tsl.get_live_pnl()

Please guide

Hi @Tradehull_Imran
I was trying to use the get_optionchain() function…but getting the below error. Could you pls look into it?
Thanks

opt_chain = tsl.get_option_chain('NIFTY', 'NSE', '26-12-2024',10)
	

However its giving the below error

Codebase Version 2.3 : Solved - ATM issues
-----Logged into Dhan-----
reading existing file all_instrument 2024-12-20.csv
Got the instrument file
Getting Error at Option Chain as '<' not supported between instances of 'int' and 'str'

The error is coming at this point in the code.

if len(expiry_list)<expiry:
	Expiry_date = expiry_list[-1]
else:
	Expiry_date = expiry_list[expiry] 

@kristrades99

If u look at the error (Getting Error at Option Chain as ‘<’ not supported between instances of ‘int’ and ‘str’), u are trying to compare len(expiry_list), which is int and expiry, which is str. need to do a like to like comparison.

@AmitKAswani - i understand that…however, the code is from Dhan_Tradehull_V2 file and so I’ve asked @Tradehull_Imran to check and rectify the same

1 Like

Hi sir, I am getting the error. Here is the code and cmd files.
Please suggest sir.

`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

---------------for dhan login ----------------

client_code = “-----------”
token_id = “------------”

tsl = Tradehull(client_code,token_id)

call_list = [“NIFTY 26 DEC 24000 CALL”, “NIFTY 26 DEC 23950 CALL”, “NIFTY 26 DEC 23900 CALL”, “NIFTY 26 DEC 23850 CALL”, “NIFTY 26 DEC 23800 CALL”, “NIFTY 26 DEC 23750 CALL”, “NIFTY 26 DEC 23700 CALL”, “NIFTY 26 DEC 23650 CALL”, “NIFTY 26 DEC 23600 CALL”, “NIFTY 26 DEC 23550 CALL”, “NIFTY 26 DEC 23500 CALL”, “NIFTY 26 DEC 23450 CALL”, “NIFTY 26 DEC 23400 CALL”, “NIFTY 26 DEC 23350 CALL”, “NIFTY 26 DEC 23300 CALL”, “NIFTY 26 DEC 23250 CALL”, “NIFTY 26 DEC 23200 CALL”, “NIFTY 26 DEC 23150 CALL”, “NIFTY 26 DEC 23100 CALL”, “NIFTY 26 DEC 23050 CALL”, “NIFTY 26 DEC 23000 CALL”]

ltp_data = tsl.get_ltp_data(names = call_list)

for script_name,ltp in ltp_data.items():

if ltp < 50:
	print(f"for {script_name} the ltp is {ltp}")
	break

`
-------------------------ERROR--------

C:\Users\LENOVO PC\Desktop\RP\DHAN Algorhythemic Trading\1. Api Upgrade>py "1. Easy way to get LTP.py"
Mibian requires scipy to work properly
Codebase Version 2.3 : Solved - ATM issues
Traceback (most recent call last):
  File "1. Easy way to get LTP.py", line 10, in <module>
    import talib
ModuleNotFoundError: No module named 'talib'

type or paste code here

@Tradehull_Imran :point_up: