Skip to content

Getting Started

Pine2Trade integrates with MetaTrader 5 and processes trading commands received in a specific JSON format. The EA receives a command string containing key trade parameters such as operation (buy/sell), symbol, stop loss, take profit, and additional details. It then parses the command, calculates trade sizes based on your risk management settings, and executes the appropriate trading actions.

Features

  • Real-Time Signal Processing: Receives and processes trading signals through a WebSocket connection.
  • Automated Trading: Executes buy, sell, and close operations automatically based on received commands.
  • Risk Management: Configurable parameters such as RiskPercent and MaxLots determine trade size.
  • Customizable Commands: Supports a flexible command format with parameters like tp, sl, comment.
  • Error Handling: Provides detailed feedback on execution status and errors for troubleshooting.

1. Sign Up and Buy a License

Create your account at pine2trade.com and buy a license.

2. Connect to TradingView

In your TradingView alerts, set the webhook URL to:

https://hook.pine2trade.com/

3. Installation & Setup

MetaTrader 5 Environment: Ensure MetaTrader 5 is installed on your system.


1. Open the Data folder

Open the Experts folder


2. Open the Advisors directory inside Experts

Navigate to the MQL5/Experts folder from your MetaTrader data directory.

Open Advisors


3. Copy the EA files

Inside the Experts folder, open the Advisors subdirectory. Copy EA Files Copy EA Files 2 Copy EA Files 3

Place both Pine2Trade.ex5 and Pine2Trade_Helper.ex5 into the Advisors folder.


4. Go Back to MetaTrader and locate the Expert Advisors panel

Expert Advisors Panel Open MetaTrader 5 and look for the Expert Advisors section in the Navigator panel.


5. Refresh the Expert Advisors list

Refresh Expert Advisors Right-click on Expert Advisors and click Refresh to load the new .ex5 files.


6. Verify the Expert Advisors are loaded

EA Loaded You should now see both Pine2Trade and Pine2Trade_Helper listed under Advisors.


7. Attach Pine2Trade to a chart

Attach EA Right-click Pine2Trade and select Attach to Chart.


8. Enable DLL Imports

Enable DLL Imports In the Dependencies tab, make sure "Allow DLL imports" is checked. This is required for the EA to function properly.


9. Switch to the common tab

Open Data Folder In the Common tab, Enable Algo Trading.


10. Enter your license key and settings

MQL5 Folder Under the Inputs tab, enter your license key and configure other parameters such as RiskPercent, MaxLots, and EMAMagicNumber.

Input Parameters:

  • license: Your license key (e.g., 123456789).

  • RiskPercent: The fraction of your account balance to risk per trade (default is 0.01 = 1%).

  • MaxLots: The maximum number of lots to trade (default is 50).

  • Expert_MagicNumber: Unique identifier used to track trades (e.g., 26198).


11. Verify successful EA initialization

EA Running If everything is configured correctly, you'll see Pine2Trade attached to the chart and confirmation logs in the Experts tab below.


12. Install the Pine2Trade Helper

Open a chart for another symbol Open Chart Window

Right-click on the symbol (e.g., GBPUSD) in the Market Watch panel and select Chart Window to open a new chart.


13. Attach Pine2Trade_Helper to the new chart

Attach Helper EA

In the Navigator panel, right-click Pine2Trade_Helper and choose Attach to Chart.


14. Enable algo trading for the helper EA

Enable Algo Helper Ensure Allow Algo Trading is checked, then click OK to activate the helper.


15. Confirm Pine2Trade_Helper is running

Helper Running You should see Pine2Trade_Helper in the top-right corner of the chart and a message in the terminal log confirming it has started.


16. Ensure Algo Trading is enabled globally

Enable Algo Trading Make sure the Algo Trading button is enabled (green) in the MetaTrader toolbar. This allows all expert advisors to run.


➡️ Now to learn about the commands and format, visit the Command Format section.