For traders seeking to automate their strategies, OpenAlgo and TradingView offer a powerful combination. OpenAlgo is an open-source algo-trading platform allowing seamless integration with various brokers and charting tools, including TradingView. By connecting these platforms, you can execute your TradingView strategies automatically without writing any code!
Why Tradingview?
TradingView is a trading platform for traders and investors that offers a range of tools for analyzing and visualizing market data, such as charts, indicators, strategies, backtesting tools, and social trading features. One of the features offered by TradingView is the ability to create and test trading strategies using a built-in programming language called PineScript.
Prerequisites:
- OpenAlgo: Ensure you have OpenAlgo installed in a Python environment (preferably Python 3.10 or higher).
- Ngrok: Install and configure Ngrok with a custom domain for secure communication between platforms.
- .env File: Set up your .env file with the Ngrok custom domain and other necessary configurations.
Tradingview Strategies
Tradingview these days is quite popular for trading strategies and more than 10000+ open-source trading strategies are already available in the Tradingview public library.
To create a strategy in TradingView, users must first choose a chart and apply any desired indicators or studies. They can then use PineScript to define the conditions under which they want to buy or sell, as well as set any other parameters such as stop-loss and take-profit levels. Once the strategy is complete, users can backtest it using historical data to see how it would have performed in the past. They can also use the Strategy feature to monitor the market in real time, automate the trades using the webhook feature, and receive alerts when their defined conditions are met.
OpenAlgo Smart Order Feature
PlaceSmartOrder in OpenAlgo is an intelligent API control used to match the position book of the trading account
Action (API Parameter) | Quantity (API Parameter) | Position Size (API Parameter) | Current Open Position (Trading Account) | Action Taken by Algomojo (Execution) |
BUY | 100 | 0 | 0 | No Open Position Found. Hence Buy +100 qty |
BUY | 100 | 100 | -100 | BUY 200 to match the Open Position given in API Parameter |
BUY | 100 | 100 | 100 | No Action was Taken as the Position is already matched |
BUY | 100 | 200 | 100 | BUY +100 to match the Open Position given in API Parameter |
SELL | 100 | 0 | 0 | No Open Position Found. Hence SELL -100 qty |
SELL | 100 | -100 | +100 | SELL 200 to match the Open Position given in API Parameter |
SELL | 100 | -100 | -100 | No Action was Taken as the Position is already matched |
SELL | 100 | -200 | -100 | SELL – 100 to match the Open Position given in API Parameter |
Steps to Integrate Tradingview with OpenAlgo SmartOrder – API
Step 1: Select the Trading Strategy to be Automated. Apply the Strategy to the Chart
![](https://i0.wp.com/www.marketcalls.in/wp-content/uploads/2022/12/image-8.png?resize=1024%2C604&ssl=1)
Step 2 : Verify the Backtesting Results (open the strategy tester and check the equity and drawdown)
![](https://i0.wp.com/www.marketcalls.in/wp-content/uploads/2022/12/image-9.png?resize=1024%2C629&ssl=1)
Step 3: Set the Trading Quantity in the Properties Section – open the strategy settings (gear icon) and goto the properties tab and set the order size as shown below. One the OrderSize is Set the Same Position Sizing will be reflect over the charts.
Bingo! Now the Alerts are Configured. Its any signals fired will be automatically reflected in your trading account in an intelligent way and that too without writing a single line of code.