This video explains an intraday stock trading algorithm built using Pine Script and Dhan API integration.
The strategy is based on ORB (Opening Range Breakout) with EMA confirmation.
📊 Logic explained simply:
• ORB High and ORB Low are formed from the first candle of the session
• EMA is used as a trailing filter
• Long entry happens when price breaks above ORB High and stays above EMA
• Short entry happens when price breaks below ORB Low and stays below EMA
• Trades are allowed only during the selected entry session
• EMA is used for exit during live trading
• Time-based exit closes all positions before market close
• Webhook alerts are generated automatically for Dhan intraday orders
⚡ This setup can be used for fully automated intraday stock trading using TradingView alerts + Dhan API.
Settings Used
🕘 Entry Session: 09: 15 – 14: 45
⏰ Exit Session: 14: 45 – 15: 30
📉 Trailing EMA Length: 21
📦 Quantity: User defined
🏦 Exchange: NSE
🔐 Secret Key: Required for webhook security
📅 Start Date Filter: Enabled
📌 Important Notes
• This is for educational purposes only
• Always paper trade before using real capital
• Modify logic as per your risk management
If you want the Dhan library, webhook setup, or MT5 integration tutorial, comment below 👇🙂
Happy Trading 🚀📊
TimeStamp
00: 00 Set-Up
00: 60 Coding Part
15: 13 Output
#pinescript #algotrading #tradingview #quant #pinescriptstrategy #tradingingstratergy #strategy #trading
Pine Script Course ( Begginner to Advance ):
https://youtube.com/playlist?list=PLxrAqvvj5LYK_jizlinvyX_CzpdaRYdbR&si=q-cpxM95eYTXksXC
More Playlists:
Pine Script Strategies in hindi
https://youtube.com/playlist?list=PLxrAqvvj5LYJRwGzdwCBfLLglBPOFLFqC&si=QIDQmHzuQ_s3H_w9
Basic Indicators with Pine Script:
https://youtube.com/playlist?list=PLxrAqvvj5LYL73s-DYs-s9Zez9HV40-ZU&si=DoO37_DN7_YnEyjD
Social Media links
Whatsapp Bussinesss( for personal project ):
https://wa.me/919136968664
Open A Free Trading account with Dhan 💯
https://join.dhan.co/?invite=MEXKH89016
Telegram Channel Link (Codes Pine Script) :
https://t.me/StrategyCoders
TradingView:
https://www.tradingview.com/u/Shivam_Mandrai/
LinkedIn :
https://www.linkedin.com/in/shivammandrai/
Git Hub:
https://github.com/Shivammandrai
Telegram Channel 2 Link (Codes Python):
https://t.me/+R-QNl0R5z1E1Nzdl
Disclaimer :
This Video is not financial advice, it’s for educational purposes only highlighting the power of pine script, I am not a SEBI-registered advisor. Trading and investing involve risk, and you should consult with a qualified financial advisor before making any trading decisions. I do not guarantee profits or take responsibility for any losses you may incur.