Beginner Algo Trading series 2026 | Codes | Youtube

Hi @vikasmfro ,

DhanHQ is rejecting the SciPy version as unsafe/incompatible.

In the requirements.txt file, change:

scipy

to:

scipy==1.13.1

Use the version compatible with your Python version and project requirements.

Dear Dhan team,

Have any update upon the dhancloud , because some UI is not showing security friendly like in credential option Global Variables are visible but in YT video series Imran sir shows best ui but not its toally different. and also a request to share more informational video and practical setup about dhan cloud product.

Your all products are good but need to share some regular information videos about how to use in easy and best way so that all user experience can be enhance and good.

At the End

Thanks for your All Products

Advance technicism & your whole team efforts

Hello Imran Sir
For intraday we use MIS in code
what if I want to do Swing trade for some days and want to carry forward the position
CNC would cancel the order as Day gets over.
what should be the parameter for GTT orders ?

Hi @Priyesh_Sharma ,

For an equity swing trade, a filled CNC position will not be squared off at the end of the day. The DAY validity applies to the entry order: any unfilled quantity expires at market close. Once the CNC buy fills, the shares are held for delivery.

For a target and stop-loss that remain active across sessions, place a CNC OCO Forever/GTT sell order after confirming the entry is filled.

Refer this code for the

from Dhan_Tradehull import Tradehull

client_code = "YOUR_CLIENT_CODE"
pin         = "YOUR_DHAN_PIN"
totp_secret = "YOUR_TOTP_SECRET"

tsl = Tradehull(ClientCode=client_code,mode="pin_totp",pin=pin,totp_secret=totp_secret)

symbol   = "RELIANCE" 
quantity = 1

entry_price = 1400.0
target      = 1500.0
stop_loss   = 1380.0


order_id_cnc = tsl.order_placement(tradingsymbol=symbol,exchange="NSE",quantity=quantity,price=entry_price,trigger_price=0,order_type="LIMIT",transaction_type="BUY",trade_type="CNC",)

print("Order ID:", order_id_cnc)
order_id_oco = tsl.place_forever_order(tradingsymbol=symbol,exchange="NSE",transaction_type="SELL",quantity=quantity,order_type="LIMIT",trade_type="CNC",price=target,trigger_price=target + 0.05,order_flag="OCO",quantity_1=quantity,price_1=stop_loss,trigger_price_1=stop_loss - 0.05,)

print("OCO GTT  ID:", order_id_oco)

Replace the sample symbol, quantity, and prices. Submit the GTT only after verifying the entry has filled, and ensure its quantity matches the filled CNC holding.