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

  1. MetaTrader 5 Environment: Ensure MetaTrader 5 is installed on your system.
  2. EA Installation: Place the Pine2Trade.mq5 file in the appropriate Expert Advisors directory.
  3. Configure Input Parameters:
  4. license: Your license key (e.g., 123456789).
  5. RiskPercent: The fraction of your account balance to risk per trade (default is 0.01 = 1%).
  6. MaxLots: The maximum number of lots to trade (default is 50).
  7. Expert_MagicNumber: Unique identifier used to track trades (e.g., 26198).

Signal Command Format

Signals can be sent to the EA via a webhook in two formats:

  1. JSON Format:
{
  "license": "123456789",
  "type": "signal",
  "signal": "123456789,buy,EURUSD,tp=100,sl=100,comment=123456"
}
  1. Legacy Format:
123456789,buy,EURUSD,tp=100,sl=100,comment=123456

Both formats are supported and will be processed the same way by the EA.

➡️ To learn more about the command format, visit the Command Format section.