Hi, I have a Pine Script-based strategy for options buying, and before deploying it for live trading, I want to properly test and evaluate its performance.
How can I check the strategy’s historical and real-time performance using Dhan HQ? I would like to understand the complete process—from connecting or converting my Pine Script strategy for execution, to paper trading/backtesting it and analyzing important metrics such as:
- Total Profit & Loss
- Win Rate
- Risk–Reward Ratio
- Maximum Drawdown
- Number of Trades
- Accuracy in different market conditions
- Performance of Stop Loss and Take Profit levels
- Slippage and brokerage impact
- Actual performance specifically for options buying
My main goal is to validate the strategy thoroughly in a simulated or paper-trading environment before risking real capital.
Please explain the best workflow and tools available in Dhan HQ for testing a Pine Script-based options buying strategy before making it live.
Hi @Jasleen_Kaur ,
If you have your own strategy and wish to automate it, you can use our Trading APIs and Data APIs to connect your algo setup with Dhan. The APIs allow your algo set-up to receive market data from Dhan and place or manage orders on the Dhan platform.
You can use the historical data available through our Data APIs to create your own backtesting or simulation setup and evaluate your strategy based on parameters such as P&L, win rate, drawdown, risk-reward, number of trades, slippage, brokerage impact, and other relevant metrics. However, Dhan does not provide a ready-made backtesting or simulation setup for custom strategies. This setup and analysis will need to be managed from your end.
Once your algo setup is developed, you can also use Dhan Cloud to run your code without having to host it on your own system. Dhan Cloud is available on a pay-per-use model, with charges applicable based on usage.
Please note that the complete coding and development of the strategy needs to be handled from your end. Dhan provides the APIs required to connect your existing algo setup with the Dhan platform for market data and order execution, but does not provide strategy development, coding, or a ready-made backtesting setup for custom strategies.
For any further queries, please feel free to contact us at apihelp@dhan.co.