Learn Algo Trading with Python | Codes | Youtube Series

Yes, correct…!

@Tradehull_Imran sir
kya hamne shi likha hai
(sl =trade_info[‘sl’] or SUPERT_7_3.0 in me koi ek)

sl_hit = index_ltp > trade_info['sl'] if index_ltp > trade_info['sl'] else index_ltp > running_candle_1['SUPERT_7_3.0']

Hi @Tradehull_Imran , Thank you for your educational series. I have recently started using the TradeHull and Dhan for my Algo strategy. I am trying to fetch 20 period and 50 period EMA from TA-Lib. For some reason, the 20 EMA matches exactly with charts but 50 EMA has different value than chart. I analyzed this and this may be due to the number of records pulled out of the dataframe for 15 mins time frame. I would like to pull the intraday minute data for around 6-8 days to give more data to process 50 EMA. Currently its coded in TradeHull to pull the data only for 3 days. Is there any limit from Dhan to fetch intraday minute data for 6-8 days?


while running files from session 3 i got this error @Tradehull_Imran


i have installed python from the session 2 files but why i am getting this ? @Tradehull_Imran

Thanks Sir now its working

brother,how is this strategy working?

Sir, how to scan my listed stocks fast? please give e some tip

HI @babji3
Testing period me hai abhi

okay, kyun ke mai is algo ke sath hedging karna chata hun

Hi @vinay_kumaar

The code seems to be correct.
The SL hit will be True if either of the condition is valid

Hi @Delta_Trading

use below code

   CE_name, PE_name, strike_price = tsl.ATM_Strike_Selection(Underlying='NIFTY', Expiry=0)

Expiry (int): The expiry to select.
0 - Current week/month (depending on expiry type)
1 - Next week/month (depending on expiry type)
and so on for subsequent weeks/months.

Hi @iam_karthik

Currently Dhanhq provides historical data for last 5 working days,
To keep a safety buffer we have set it to last 3 days in codebase.

You can make the changes in get_start_date function in codebase to get last 5 trading days data.

1 Like

Hi @SUDHANSU_SEKHAR_MAHA

Python seems to be installed but the path is not being recognized by the system

We need to reinstall, and check box for “Add python 3.8 to path”

Reference video : https://youtu.be/YAyIoDJYorA?si=TTYq-Fs32tBDn_pI&t=150

Do uninstall everything and make a fresh installation.

Hi @babji3

Adding @Hardik

Speed of scanning depends on the rate limit,
one way to scan faster is to do pre market scanning , which will make our watchlist shorter and scanning faster.

Although if the rate limits are relaxed the scanning will be naturally faster.

2 Likes

sir, i strategy, there is no pre market scanning, at running market I want to filterout some stocks that will met my conditions. now the scanning is taking 3 minuts to scan the list almost 200+

The scanning speed is constrained by rate limits set by data providers. without relaxing these limits, it is not possible to further reduce the scanning time.

1 Like

also I found an issue that old codebase were firing orders properly fo Nifty options but gives error for SENSEX options.

now the new codebase works perfectly with Sensex options but doest work with nifty options.

please check woth both indices options…

thank you sir

1 Like

Hi @Qaisar

Order placement is working fine do refer this code.


# for NIFTY
entry_orderid  = tsl.order_placement(tradingsymbol='NIFTY 02 JAN 24900 CALL' , exchange='NFO', quantity=750, price=0, trigger_price=0, order_type='MARKET', transaction_type='BUY', trade_type='MIS')


# for SENSEX
entry_orderid  = tsl.order_placement(tradingsymbol='SENSEX 27 DEC 78800 CALL' ,exchange='BFO', quantity=300, price=0, trigger_price=0, order_type='MARKET', transaction_type='BUY', trade_type='MIS')


codebase being used : Dhan_Tradehull_V2.py - Google Drive