TradeSgnl Logo
TradeSgnl
Docs
Portal

Backtesting with TradeSgnl

Test and analyze your trading strategies with advanced risk management features.

This guide walks you through the process of backtesting your trading strategies using the TradeSgnl EA and analyzing the results in our advanced dashboard. Learn how to transform your TradingView strategies into sophisticated trading systems with enhanced risk management and trade execution.

Introduction to Backtesting


Backtesting is a critical process for evaluating trading strategies using historical data before risking real capital. The TradeSgnl EA offers powerful backtesting capabilities that allow you to:

Enhanced TradingView Strategies

Test TradingView strategies with advanced trade management features including trailing stops, pyramiding, and recovery systems

Versatile Signal Processing

Validate any CSV-based trading strategy from any source that can export to CSV format

Professional Performance Metrics

Gain insights through comprehensive statistics and interactive charts

Risk Management Optimization

Fine-tune stop loss, take profit, and position sizing settings for optimal performance

Unlike simple backtesting systems that only simulate basic entries and exits, the TradeSgnl backtesting system incorporates sophisticated trade management features that can significantly improve your strategy's performance.

Preparing Your CSV File


The TradeSgnl EA uses a CSV (Comma-Separated Values) file as input for backtesting. This file contains your trade signals, including entry and exit points. Here's how to create and format your file correctly:

Required Columns
  • Type

    Values should be: ENTRY LONG, ENTRY SHORT, EXIT LONG, or EXIT SHORT (case-insensitive)

  • Date/Time

    Preferred format: DD/MM/YYYY HH:MM:SS (e.g., 15/06/2023 10:00:00)

Optional Column
  • Comment

    Use comments to categorize trades or differentiate between strategies

  • The Comment field is extremely useful for:

    • Testing multiple variations of a strategy in a single backtest
    • Separating data for different symbols or timeframes
    • Filtering results in the analytics dashboard
    Sample CSV File Format

    Create a spreadsheet with the following columns and format:

    CSV File Format Example
    Type
    Date/Time
    Comment
    ENTRY LONG
    15/06/2023 10:30:00
    MACD_Cross
    EXIT LONG
    15/06/2023 14:45:00
    MACD_Cross
    ENTRY SHORT
    16/06/2023 09:15:00
    MACD_Cross
    EXIT SHORT
    16/06/2023 15:30:00
    MACD_Cross
    ENTRY LONG
    17/06/2023 11:00:00
    RSI_Overbought
    EXIT LONG
    17/06/2023 16:15:00
    RSI_Overbought

    Note: This example shows how the data would appear in spreadsheet software like Microsoft Excel or Google Sheets. We recommend using these tools to create and edit your files for simplicity, then saving them as CSV format when finished.

    Exporting from TradingView


    One of the most powerful features of the TradeSgnl backtesting system is the ability to take strategies developed in TradingView and enhance them with our advanced risk management features. Follow these steps to export your TradingView strategy results:

    Create a strategy in TradingView

    You have several options for creating your trading strategy:

    • Pine Script

      Develop a custom strategy using TradingView's Pine Script language

    • Built-in TradingView Strategies

      Use TradingView's pre-built strategies and customize parameters

    • TradeSgnl Strategy Builder (Documentation)

      Use our intuitive strategy builder to create strategies without coding

    TradingView Strategy Editor
    TradingView Pine Script Editor with a simple strategy example
    Run your strategy and export trade data

    After creating your strategy, test it and export the results:

    • Add your strategy to the chart and adjust settings if needed
    • Click on the 'Strategy Tester' tab at the bottom of your chart
    • In the Strategy Tester panel, click on the 'List of Trades' tab
    • Click on the strategy name dropdown on the top left of the panel
    • Select 'Export data'
    • The file will be saved to your browser's default download location (typically the Downloads folder)
    Exporting trades from TradingView
    Exporting trade data from TradingView Strategy Tester
    Format the exported file

    The TradeSgnl EA is already optimized to work with TradingView's export format (as of May 25, 2024), so only minimal modifications are needed:

    • Open the downloaded file in Excel, Google Sheets, or another spreadsheet program
    • Delete all sheets except for the 'List of Trades' sheet
    • In the 'List of Trades' sheet, you can delete all columns except 'Type' and 'Date/Time'
    • Optionally add a 'Comment' column to categorize your trades

      This is useful for identifying different strategies or testing variations

    • Save the file as CSV format in your MetaTrader 'MQL5/Files' folder (or specify a different location in the EA settings)
    Converting TradingView Export to TradeSgnl Format
    Example of minimal modifications needed for TradingView export
    Saving as CSV format
    Save the file in CSV format using the 'Save As' dialog
    Testing Multiple Strategies Together

    To test how multiple strategies work together:

    • Export each strategy separately from TradingView
    • Format each file as described above
    • Add a 'Comment' column to each file with a unique identifier for each strategy
    • Combine all strategies into a single CSV file by copying and pasting the rows
    • Make sure to maintain the column headers in the combined file

    Setting Up MT5 Backtest


    After preparing your CSV file with trading signals, you're ready to set up and run your backtest with the TradeSgnl EA. Follow these steps to get actionable results:

    Install and locate the TradeSgnl EA

    If you haven't already installed the TradeSgnl EA, download it from your dashboard and install it in your MetaTrader 5 terminal. For detailed installation instructions, refer to our Setup Guide.

    Place your CSV file in the correct location

    The CSV file needs to be placed in a specific folder for the EA to find it. Follow these steps:

    Step 1: Open Data Folder from MT5

    In MetaTrader 5, click on the "File" menu and select "Open Data Folder"

    Open Data Folder in MT5
    Open Data Folder from the File menu in MT5
    Step 2: Navigate to Terminal Folder

    When the MQL5 folder opens, go up one directory level to the "Terminal" folder

    Navigate to Terminal Folder
    Navigate up one level to the Terminal folder
    Step 3: Open Common/Files Folder and Place Your CSV

    Inside the Terminal folder, open the "Common" folder, then open the "Files" folder. Copy your CSV files into this folder.

    Common and Files Folders
    Navigate to Common → Files folder
    Place CSV File in Files Folder
    Place your CSV file in the Files folder
    Open and configure the Strategy Tester

    Open the Strategy Tester and select the TradeSgnl EA:

    • Press Ctrl+R or select View → Strategy Tester to open the Strategy Tester
    • Select the TradeSgnl EA from the Expert Advisor dropdown
    • Choose the symbol (currency pair) you want to test
    • Set 'Model' to 'Every tick' for the most accurate results
    • Select a date range that covers all trades in your CSV file
    MT5 Strategy Tester Configuration
    Strategy Tester configuration with TradeSgnl EA selected
    Configure EA parameters

    Click "Expert properties" (or press F7) to configure the TradeSgnl EA parameters:

    Essential Parameters
    • license_code

      Enter your valid TradeSgnl license with active subscription

    • CSV_File_Base

      The name of your CSV file without extension (default: 'Trades')

    • csv_exits

      Set to true to include exit signals from the CSV file

    Optional Parameters

    Trade Settings

    • volume_type

      Position sizing method

    • default_volume

      Trade size

    • default_sl

      Stop loss in pips

    • default_tp

      Take profit in pips

    Advanced Features

    • trailing_settings

      Trailing stop configuration

    • pyramid_settings

      Pyramid trading configuration

    • recovery_settings

      Recovery system configuration

    TradeSgnl EA Parameters
    Configuring TradeSgnl EA parameters for backtesting
    Run the backtest and view results

    Click "Start" to begin the backtest process:

    • The EA will validate your license, then load and process your CSV file
    • You'll see trades being executed according to your CSV signals
    • Watch as the equity curve forms in the Strategy Tester window
    • When complete, MT5 will display preliminary performance metrics
    Automatic data upload to the TradeSgnl portal

    At the end of the backtest, the EA will automatically:

    • Compile comprehensive statistics about your backtest
    • Upload the data to the TradeSgnl server for detailed analysis
    • Display a confirmation message in the MT5 journal when complete
    Tip
    For accurate backtesting, try to use realistic parameters that match your live trading conditions. Pay special attention to risk management settings like position sizing, stop loss, and take profit levels.

    Analyzing Results


    Once your backtest is complete, TradeSgnl provides a comprehensive analytics dashboard where you can evaluate your strategy's performance. Access your results by logging into your TradeSgnl account and navigating to the Backtests section.

    TradeSgnl Backtest Analytics Dashboard
    The TradeSgnl backtest analytics dashboard with performance metrics and interactive charts

    The dashboard provides powerful visualization tools to help you evaluate your strategy:

    Key Performance Metrics
    • Profitability metrics (net profit, profit factor)
    • Risk metrics (drawdown, Sharpe ratio)
    • Trade statistics (win rate, average trade)
    Visual Analysis Tools
    • Interactive equity and drawdown charts
    • Trade distribution and performance by period
    • Detailed trade-by-trade breakdown
    View Backtest Analytics
    Tip
    For the most effective strategy optimization, focus on risk-adjusted metrics like Sharpe ratio and drawdown alongside raw profitability. A truly robust strategy balances profitability with acceptable risk levels and shows consistent performance across different market conditions.

    Best Practices and Tips


    To get the most out of the TradeSgnl backtesting system, follow these best practices and tips:

    Data Quality
    • Use high-quality historical data

      Ensure your broker provides accurate tick data for best results

    • Check CSV file format carefully

      A single formatting error can affect the entire backtest

    • Verify time zones

      Ensure your CSV file time stamps match your MT5 data time zone

    Testing Strategy
    • Test across multiple time periods

      Include bull, bear, and sideways markets

    • Test multiple instruments

      Verify your strategy works on different currency pairs or assets

    • Use realistic settings

      Avoid curve-fitting by using practical risk and money management settings

    Advanced Optimization Tips
    Risk Management Optimization

    Test different combinations of stop loss and take profit levels to find the optimal risk-reward ratio for your strategy. The EA's advanced risk management features can dramatically improve a strategy's performance.

    Trade Size Optimization

    Experiment with different position sizing methods: fixed lot sizes vs. percentage-based risk. The latter often provides more consistent equity growth and better risk management.

    Advanced Feature Combinations

    Try different combinations of trailing stops, pyramiding, and recovery systems. Sometimes, the interaction between these features creates synergies that significantly enhance performance.

    By combining TradingView's strategy building capabilities with the advanced trade management features of the TradeSgnl EA, you can create robust trading systems that would be impossible to implement in TradingView alone.

    FAQ


    Yes, you can use the "Comment" column in your CSV file to differentiate between strategies. Each trade entry can have a unique comment identifier, allowing you to filter and compare different strategies in the dashboard.

    The backtesting system strives to be as realistic as possible, but there are inherent limitations. It uses historical data and assumes perfect execution of trades, which may differ from live market conditions. For the most accurate results, use "Every tick" mode in MT5's strategy tester and ensure your historical data is high quality.

    Yes, the dashboard allows you to export your backtest data in various formats for further analysis in external tools like Excel or specialized trading analytics software.

    The TradeSgnl dashboard has a comparison feature that allows you to select multiple backtests and compare their performance metrics side by side. This is particularly useful when optimizing parameters or testing different strategy variations.

    There is no hard limit on the number of trades, but extremely large datasets (tens of thousands of trades) may take longer to process and upload. For optimal performance, consider breaking very large backtests into smaller, manageable chunks.


    Need Additional Help?

    Our support team is ready to assist you with any questions you might have.

    Email Support