I will do backtesting tradingview strategy with python, mt4, mt5, pine connector

United Kingdom

I speak English, German
Stock market / fundamental analyst / Python Developer I am a stock picker with experience in fundamental stock analysis, stock classification and final valuation for long-term performance. Whether y...
About this Gig

Backtesting Trading Strategies with Python Before deploying any trading strategy in the live market, its crucial to validate it through backtesting. 


Backtesting involves testing a trading strategy using historical data to assess how it would have performed in the past. 


Key feature :


  • For handling time series data.
  • To fetch historical stock data.
  • For plotting the results.
  • For numerical calculations.


We calculate the 50-day and 200-day SMAs using the rolling mean function. A buy signal is generated when the 50-day SMA is greater than the 200-day SMA. The position column indicates when to enter or exit a trade.


We plot the cumulative returns of the strategy and the market on the same chart to visualize the strategys performance.



The Python code provided here offers a solid foundation for backtesting various strategies, allowing traders to experiment and refine their approaches before risking real capital.


This visualization helps traders understand whether their strategy outperforms the market and by how much.

Platform:

TradingView

MT5

MT4

Development technology:

Python

MQL5

MQL4