📈 Connect TradingView to MT4

Follow this guidelines to connect TradingView to MT4. If you don't have an Pip Sender account yet, you can sign up for a free account here.



Step 1: Create a MT4 connection

  1. Select Connect Hub in your Dashboard
  2. In the list of available apps, click Connect button on the MetaTrade 4 app
Available apps
  1. Fill the form with name of your connection
  2. Click Save and your TradingView to MT4 connection will be created
Connect TradingView to MT4

Step 2: Download Pip Receiver

After completing Step 1, you have a TradingView to MT4 connection with information as below picture.

  1. Go to Settings tab
  2. Click Download button to download Pip Receiver. You'll receive a Pip Receiver MT4.zip file.
  3. Extract the zip file above and you have these 2 files:
    • Pip Receiver MT4.ex4
    • Pip Receiver MT4.dll

Pip Receiver is an Expert Advisor installed in your terminal to manage trades on your trading account. It also allows you to configure advanced features such as symbol mapping, risk management, and scheduled tasks.

Download Pip Receiver MT4

Step 3: Install Pip Receiver in MetaTrader terminal

  1. Open Expert folder of your MetaTrader terminal

    • Open MetaTrader terminal
    • Go to File → Open Data Folder
    • Navigate to: MQL4/Experts
  2. Copy both of 2 files you downloaded (and extracted) in step 2 above into Expert folder

  3. Back to MetaTrader terminal

    • In navigator, right click on Expert Advisors
    • Click Refresh to show new experts
  4. Double-click on Pip Receiver MT4 in the expert list to install

    • On the Inputs tab, enter License Key. License Key is available in the Overview tab of your connection (you created it via Pip Sender Dashboard in step 1).
    • On Common tab, Enable Allow DLL imports
  5. Make sure Allow Algo Trading is turned on in your MetaTrader terminal.


Pip Receiver can be installed on any chart and will process trades for all symbols.


Ready to get started? Sign up for an account here and start connect TradingView to MT4.


Helpful tips

  • Pip Receiver is powerful with many settings, but only License Key is required. Other settings can stay at default initially. Learn how to set them up later in below section.

  • Click Refresh button in your MT4 connection to see if Pip Receiver is connected. If your account details not show, check the Experts tab in MetaTrader to see errors.

  • Pip Receiver must remain running to process trading signals. Using a VPS is highly recommended.

  • Pip Receiver will automatically reconnect after network disconnections. Temporary "Disconnect" → "Connect" messages are normal. However, frequent disconnects may indicate network issues or an unstable VPS.

  • If you can't install the Pip Receiver, check Experts tab in your MetaTrader terminal for details.

  • If you installed the Pip Receiver successfully but no trades processed, check Logs tab of connection in your Pip Sender Dashboard for details.


Common errors

If Pip Receiver is not installed correctly, you will see an error message in the terminal’s Experts log.

Pip Receiver MT4 error logs

Here are some common error messages you may see:

  • DLL is not allowed: It means you forgot to allow DLL import. On Common tab, enable Allow DLL imports.

  • No license data provided: It means you didn't provide License Key in Inputs tab. Please provide a valid License Key.

  • Invalid license provided: It means you provided wrong License Key. Check and provide a valid License Key. Go to your Dashboard and click Copy button to prevent mistakes.

  • Same account is already connected: This account is already connected using the same License Key. To avoid duplicate trading signals, this is not allowed.

  • Unable to connect to server: An unknown error occurred while connecting to our server. Please check your internet connection and try again.


Pip Receiver MT4 setup

Pip Receiver inputs are grouped into sections. See them below. Only License Key is required. Other settings can stay at default initially.

Pip Receiver MT4

General

  • License Key: License Key of your MT4 connection.

  • Magic Number: Magic number for all trades. You can use it to filter trades later.

  • Max Deviation: Maximum price slippage you are willing to accept when placing a trade.


Symbol Mapping

  • Symbol Prefix: Use this for the Symbol Mapping feature.
    For example:

    • You receive the message with symbol=EURUSD
    • Symbol Prefix is m_ → Trades will be placed with the symbol=m_EURUSD
  • Symbol Suffix: Use this for the Symbol Mapping feature.
    For example:

    • You receive the message with symbol=GOLD
    • Symbol Suffix is # → Trades will be placed with the symbol=GOLD#
  • Mapping List: Use this to map special symbol names.

    For example: You may receive alerts from TradingView or signal sources using names like Gold or Silver, while your broker uses XAUUSD and XAGUSD.

    • You receive the message with symbol=GOLD
    • Your mapping list is Gold=XAUUSD, Silver=XAUUSD → Trades will be placed with the symbol=XAUUSD

    Notes:

    • Separate multiple mappings with commas
    • Use the format sourceSymbol=destinationSymbol for each item
    • If Symbol Prefix and/or Symbol Suffix is configured, they are applied after the mapping list is processed

All symbol mapping options are case-insensitive and automatically mapped.


Risk Management

  • Allowed symbols: List of allowed symbols. Signals with symbols not in list will be ignored.

    • Leave it blank to allow all symbols
    • Separate multiple symbols by commas
    • Symbol mapping is processed before checking for allowed symbols. So using the final symbol here.
      For example:
      • Symbol Suffix is #
      • Mapping list is Gold=XAUUSD, Silver=XAUUSD
        → To allow only Gold trades, use Allowed symbols = XAUUSD#
  • Min Trade Size: The minimum allowed trade size.

  • Smaller sizes will be rounded up.

  • Use 0 as no limit.

  • Max Trade Size: The maximum allowed trade size.

    • Larger sizes will be rounded down.
    • Use 0 as no limit.
  • Max Opening Positions: Maximum number of open positions at the same time.

    • If a new Buy/Sell signal comes but the maximum is reached, it will not be processed.
    • Use 0 as no limit.
  • Max Symbol Positions: Maximum number of open positions at the same time per symbol. Use 0 as no limit.

  • Max Daily Loss: Maximum total daily loss.
    New Buy/Sell signals will not be placed if the daily loss limit is reached.

    • Fee and commission are not included.
    • Use 0 as no limit.
  • Max Daily Profit: Maximum total daily profit.
    New Buy/Sell signals will not be placed if the daily profit limit is reached.

    • Fee and commission are not included.
    • Use 0 as no limit.
  • Filter by Magic Number: Turn On/Off this option to filter trades by Magic Number in the General section.
    For example:

    • You turn on this option.
    • You have 2 open positions: one has Magic Number 6789 (opened by Pip Receiver) and another position has Magic Number 1111 or is empty (opened by another way).
      → A close all signal message will only close the first position since it has the same Magic Number that this Expert is using.
      Otherwise, if you turn off this option, both positions will be closed.

Important notes:

  • All filters are applied before placing a new order.
    For example: New Buy/Sell signals must comply with trading date and time, and must not exceed opening position or profit limits.
  • Trade Day and Time: Applied to all signal messages, while other filters apply only to Buy and Sell actions (which affect total positions and profit).
    For example:
    • When Max Opening Positions is reached, you can still send a Close action message, and it will be processed.
    • Buy action messages, however, will be ignored if the maximum is reached.

Daily Close Schedule

  • Enable Daily Close: Enable or disable the daily close schedule.

  • Daily Close Time: The time to process the daily close schedule.

    • Use the time in hour:minute format.
    • It follows the 24-hour format. Maximum hour value is 23 and maximum minute value is 59
    • Time is trade server time
  • Daily Close Trades: Specify which trades will be closed.
    Supported values:

    • All Positions & Orders: Close all open positions and pending orders.
    • Opening Positions: Close only open positions, keep pending orders.
    • Winning Positions: Close only positions that are in profit, keep losing positions and pending orders.
    • Losing Positions: Close only losing positions, keep winning positions and pending orders.
    • Pending Orders: Close only pending orders, keep open positions.
  • Filter by Magic Number: Choose whether to filter trades by the Magic Number defined in the General section. Applies to the daily close schedule only.

Important note: To ensure your trades are processed by your broker, schedule the daily close before the broker's market close time (if applicable).


Weekly Close Schedule

  • Enable Weekly Close: Enable or disable the weekly close schedule.

  • Weekly Close Day: The weekday to process the weekly close schedule.

  • Weekly Close Time: The time to process the weekly close schedule.

    • Use the time in hour:minute format.
    • It follows the 24-hour format. Maximum hour value is 23 and maximum minute value is 59
    • Time is trade server time
  • Weekly Close Trades: Specify which trades will be closed.
    Supported values:

    • All Positions & Orders: Close all open positions and pending orders.
    • Opening Positions: Close only open positions, keep pending orders.
    • Winning Positions: Close only positions that are in profit, keep losing positions and pending orders.
    • Losing Positions: Close only losing positions, keep winning positions and pending orders.
    • Pending Orders: Close only pending orders, keep open positions.
  • Filter by Magic Number: Choose whether to filter trades by the Magic Number defined in the General section. Applies to the weekly close schedule only.

Important: To ensure your trades are processed by your broker, schedule the weekly close before the broker's market close time (if applicable).