DEV Community

Cover image for TradingView Signal Live Trading: New Version Solution
fmzquant
fmzquant

Posted on

TradingView Signal Live Trading: New Version Solution

**

TradingView: A Powerful Analysis Tool for Professional Traders

**
TradingView is currently one of the most popular financial market charting and analysis platforms in the world. It provides real-time market data covering global markets, including stocks, futures, forex, and cryptocurrencies. The platform's standout feature is its extensive library of technical analysis tools and indicators, ranging from basic moving averages, MACD, and RSI to various complex custom indicators. More importantly, TradingView hosts an active trading community where thousands of users share their trading strategies, technical analyses, and market perspectives.


One of TradingView's most powerful features is its Pine Script programming language. This scripting language is specifically designed for technical indicators and trading strategies, with relatively simple syntax that even programming beginners can quickly learn. Through Pine Script, traders can transform their trading ideas into executable strategy code and backtest them against historical data to validate their effectiveness. Many traders follow a daily workflow of opening TradingView to check market conditions, running their strategy scripts, and making analysis and decisions based on the signals generated.

TradingView's Limitations: The Idealized World of Paper Trading
Despite its powerful features, TradingView has significant limitations when it comes to live trading. The platform primarily offers "Paper Trading" functionality, which is essentially simulated trading. In a paper trading environment, everything is overly idealized: orders are always filled immediately without considering market depth and liquidity, price slippage is virtually negligible, and while fees can be configured, they still differ from real trading conditions. As a result, strategy performance in paper trading often far exceeds actual live trading results. A strategy showing 300% annualized returns in backtesting might only achieve 50% or even less in live trading—a discrepancy that leaves many traders confused and disappointed.

TradingView does offer integration with some live brokers, but the options are very limited. The supported brokers are mainly traditional forex and stock brokers like OANDA, AMP, and TradeStation. For the currently most active cryptocurrency market, major exchanges such as Binance and OKX have no direct integration support. Even for the brokers that are integrated, users frequently report unstable connections, order delays, and incomplete feature support. This is hardly surprising—TradingView's core business is providing professional charting and analysis tools and generating revenue through subscription memberships. Live trading integration involves complex technical development, regulatory compliance, and legal risks, which clearly isn't their priority.

Early Solutions: Extended API Integration
Facing the challenge of TradingView's inability to execute live trades directly, FMZ Quant platform introduced a solution back in 2020. Through extended APIs and webhook mechanisms, TradingView trading signals could be transmitted to FMZ strategy bots, which would then execute trades on real exchanges. The basic principle works as follows: when TradingView detects a trading signal, it triggers an alert that sends an HTTP request to FMZ's extended API via webhook. FMZ receives the request and forwards the instruction to the strategy bot, which parses the instruction content and places orders on the configured exchange.

The initial approach involved writing trading instructions directly in the webhook URL parameters—for example, specifying "buy:1" in the URL to indicate buying 1 coin. While this method achieved basic functionality, it lacked flexibility: the instruction content was fixed, couldn't be dynamically adjusted, and couldn't utilize variables provided by TradingView. Later in 2022, FMZ upgraded its extended API to support reading instruction content from the HTTP request body. This allowed traders to write JSON-formatted instructions in TradingView's alert messages, containing detailed information such as trading pair, price, quantity, and trade direction, while also using TradingView placeholder variables like closing price and strategy position size. This solution greatly improved flexibility, but for beginners, writing and debugging JSON-formatted messages still presented a learning curve, and the FMZ-side strategy code needed to handle complex parameter parsing and error handling logic.

Cross-Platform Copy Trading Strategy: A Completely New Approach
FMZ's recently launched "Cross-Platform Copy Trading Strategy" adopts an entirely different design philosophy, reducing the complexity of integrating TradingView signals to a minimum. The core concept of this new solution is: instead of focusing on "what trading action to execute," it focuses on "what is the current position state." In traditional approaches, TradingView sends an instruction like "buy 1 BTC," and FMZ executes the buy action. In the new approach, TradingView sends state information like "currently holding 1 BTC," and FMZ synchronizes its own position to match this state. This seemingly simple shift brings tremendous convenience: even if you start the FMZ strategy midway, or if the strategy was previously stopped, as long as TradingView sends the next position state, FMZ can automatically adjust to the correct position without position inconsistencies caused by missing historical trading signals.


In practice, traders need to deploy the "Cross-Platform Copy Trading Strategy" on the FMZ platform, select Follower mode, and set the signal source to TradingView. Once the strategy starts, it automatically generates two key pieces of information: the Webhook address and the message format. The message format is extremely simple, just one line: {{syminfo.basecurrency}}_{{syminfo.currency}},{{strategy.position_size}}. This is TradingView's placeholder syntax, which automatically replaces with actual values at runtime. syminfo.basecurrency is the base currency (such as BTC), syminfo.currency is the quote currency (such as USDT), and strategy.position_size is the strategy's current position size—positive for long positions, negative for short positions, and zero for no position.


On the TradingView side, traders simply need to enter the FMZ-generated message format in the Pine strategy's alert settings and fill in the FMZ-generated address as the Webhook URL. When the TradingView strategy triggers a trade (opening, closing, adding to, or reducing positions), the alert automatically sends the current position state to FMZ. For example, with a BTC/USDT trading pair where the strategy goes long 1 BTC, the message sent would be "BTC_USDT,1". When FMZ receives this message, it checks its actual position on the exchange. If currently flat, it opens a long position for 1 BTC; if holding 0.5 BTC, it adds 0.5 BTC; if already holding 1 BTC, it takes no action. Similarly, if TradingView closes the position and sends "BTC_USDT,0", FMZ will clear all positions; if TradingView opens a short and sends "BTC_USDT,-1", FMZ will close the long position and open a short for 1 BTC.

  • set webhook url on TradingView

  • set message on TradingView


This solution also provides rich configuration options to meet different needs. The copy trading mode can be set to "Equal Quantity" or "Equal Ratio": Equal Quantity directly replicates the same position size, suitable for accounts with similar capital; Equal Ratio follows positions based on the proportion of total capital, so if TradingView uses 50% of funds for a position, FMZ also uses 50% but the actual quantity may differ—this approach suits accounts with significantly different capital sizes. The scaling ratio parameter allows amplifying or reducing the copied quantity: setting 50% means half-size copying, 200% means double-size copying, making it convenient to adjust positions based on risk preference.


The reverse copy trading feature allows executing completely opposite operations: when TradingView goes long, FMZ goes short; when TradingView goes short, FMZ goes long. This feature can be used for hedging trades to reduce overall risk exposure, or for strategy validation to test the effects of reverse operations. The symbol restriction parameter allows specifying that only signals from certain trading pairs should be followed, with signals from other symbols automatically ignored—very useful when a TradingView strategy trades multiple coins but you only want to follow some of them. The maximum position ratio per symbol limits the maximum proportion of capital a single symbol can use, preventing excessive risk concentration in a single asset. The stop-loss function is an account-level protection mechanism that automatically clears all positions to protect capital when total account losses reach a set threshold.

Compared to previous approaches, the new copy trading mode offers a qualitative improvement in usability. Configuration requires only copying and pasting two items: the message format and webhook address. There's no need to understand JSON syntax, write complex parameter configurations, or write or modify strategy code on the FMZ side. All position synchronization logic, parameter parsing, and error handling are already encapsulated within the strategy. In terms of functionality, the copy trading mode provides a series of practical features including ratio-based copying, scaling, reverse trading, position control, and stop-loss—all of which previously required writing custom code. In terms of reliability, the design of following position states rather than trading actions ensures that even if the strategy is stopped or restarted midway, it can correctly synchronize to the current position, greatly reducing the risk of position errors caused by connection interruptions, strategy restarts, or other exceptional situations.

Note that there are some prerequisites for using this solution. Your TradingView account must be Pro level or above to use the Webhook feature—Basic free accounts don't support it. Additionally, TradingView requires two-factor authentication (2FA) to be enabled for using webhooks, which is the platform's security requirement.

For actual use, it's strongly recommended to test with small amounts of capital or a demo account first. Confirm that TradingView alerts trigger properly, FMZ receives and correctly parses the signals, the exchange successfully places orders, and positions synchronize accurately. During testing, observe whether signal latency is acceptable—typically it takes about 2-3 seconds from TradingView triggering to FMZ completing the order. Pay attention to how slippage and fees in real trading affect returns, as these are often underestimated in paper trading. Only after thorough testing confirms everything works correctly should you gradually increase the capital scale.

Conclusion
From TradingView's paper trading to real live trading, from early approaches of writing instructions in URLs to later JSON message formats, and now to position state synchronization—this evolution reflects the ongoing trend of quantitative trading tools developing toward greater usability and reliability. TradingView focuses on providing the best charting analysis and strategy backtesting tools, while quantitative platforms like FMZ focus on providing stable and reliable trade execution capabilities. Together, they allow traders to fully leverage the strengths of each.

Of course, no matter how advanced the tools are, trading strategy logic and risk control remain the keys to trading success. Even the most impressive backtested strategy on TradingView will inevitably face various unexpected situations and challenges in real markets. The cross-platform copy trading strategy simply provides a reliable execution tool that allows signals to be accurately and efficiently converted into actual trades, but it cannot replace a trader's understanding of the market, control of risk, and continuous optimization of strategies. We hope this tool can help more traders turn their ideal strategies into real profits.

Top comments (0)