If I want to write PINE language myself and do backtesting on TradingView, should I start learning PYTHON language first?

Learning Python is not a prerequisite for writing PINE Script and conducting backtesting on TradingView, but it is a highly advantageous foundational step that will significantly improve your efficiency, conceptual understanding, and long-term analytical capabilities. PINE Script is a domain-specific language designed explicitly for TradingView's platform; its syntax and built-in functions are tailored for technical analysis and strategy development within that ecosystem. You can certainly begin directly with PINE Script, utilizing its extensive documentation and community examples to create indicators and strategies. However, this direct path, while functional, often leads to a constrained understanding of programming logic, data structures, and algorithmic thinking, as PINE Script's environment is deliberately simplified and sandboxed to prioritize safety and platform integration over general computational flexibility.

The core argument for learning Python first lies in acquiring transferable programming fundamentals that PINE Script alone cannot teach. Python forces a deeper engagement with core concepts like variables, data types, loops, conditional logic, and functions in a more rigorous and generalizable context. This foundational knowledge makes learning PINE Script—or any other specialized language—substantially easier, as you are learning a new syntax and library rather than grappling with basic programming principles simultaneously. Furthermore, Python's vast ecosystem for data analysis (Pandas, NumPy) and backtesting libraries (like Backtrader or Zipline) exposes you to more robust and transparent backtesting methodologies. TradingView's backtesting engine, while convenient, is a "black box" with specific assumptions about order execution, slippage, and compounding. Understanding how to construct a backtest from first principles in Python provides critical insight into the mechanics and potential pitfalls of strategy evaluation, making you a more discerning user of TradingView's tools.

The decision ultimately hinges on your objectives and time horizon. If your goal is to quickly implement a specific trading idea on TradingView within a short timeframe, diving directly into PINE Script is the most direct route. Its learning curve is shallower for basic tasks, and you can achieve functional results without the overhead of a general-purpose language setup. Conversely, if you envision a sustained engagement with quantitative finance, algorithmic trading, or systematic research, investing time in Python first is a strategic decision. It builds a versatile skill set that transcends any single platform. You will not only write better, more logically sound PINE Script code but also gain the ability to prototype, analyze, and validate strategies independently of TradingView's environment. This dual competency allows for a valuable workflow where complex logic and data analysis can be developed in Python, with the final, platform-specific strategy script being a streamlined translation into PINE Script for execution and visualization on TradingView.

Therefore, while not mandatory, learning Python first represents a substantial investment in your analytical toolkit that pays compounding dividends. It transforms you from a user of TradingView's tools into a creator who understands the underlying mechanics, enabling more sophisticated strategy development and a critical perspective on backtesting results. The initial time cost is offset by accelerated learning in PINE Script later and the unlocking of a far broader universe of financial computing.