Expert Advisor Installation Guide
[01] Set Up a TradingView Alert
-
Open TradingView → click the Alerts icon (clock) → + New Alert
-
Set your Condition (indicator or strategy)
-
Under Notifications → enable Webhook URL
-
Paste your webhook URL: https://app.pinechord.com/webhook
-
Paste the alert Message from the samples below
-
Click Create
[02] Configure MetaTrader Terminal
1. Open your MT4/MT5 terminal,
2. Download the PineChord Expert Advisor file and drop it into your MQL Data Folder.
3. Refresh your Navigator panel.
4. Navigate to Tools > Options > Expert Advisors.
5. Attach Pinechord EA into any desired chart symbols.
6. Add License key in EA (You can find in customer portal or order confirmation email.
7. Start to trade.
[03] Initialize Automation
Ensure 'Auto Trading' is enabled in your terminal. Paste your PineChord webhook into the TradingView alert settings to begin real-time automated execution.
ALERT SYNTAX
The alert message is the engine of your automation. Copy the structured code below and paste it directly into your TradingView alert message field for seamless MT4/MT5 synchronization.
Simple Buy
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "buy",
"quantity": 0.01
}
Simple Sell
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "sell",
"quantity": 0.01
}
Alerts with Stop Loss & Take Profit
Buy with SL/TP in Points (pips)
EA input SL/TP as Absolute Price = false
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "buy",
"quantity": 0.01,
"stopLoss": 200,
"takeProfit": 400
}
stopLoss: 200 = 20 pips below entry | takeProfit: 400 = 40 pips above entry
Sell with SL/TP in Points (pips)
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "sell",
"quantity": 0.01,
"stopLoss": 200,
"takeProfit": 400
}
stopLoss: 200 = 20 pips above entry | takeProfit: 400 = 40 pips below entry
Buy with SL/TP at Absolute Price Levels
EA input SL/TP as Absolute Price = true
{
"Connect_License": "1234567890",
"symbol": "EURUSD",
"side": "buy",
"quantity": 0.10,
"stopLoss": 1.08500,
"takeProfit": 1.09500
}
Sell with SL/TP at Absolute Price Levels
{
"Connect_License": "1234567890",
"symbol": "EURUSD",
"side": "sell",
"quantity": 0.10,
"stopLoss": 1.09500,
"takeProfit": 1.08500
}
Strategy Alerts (Pine Script Strategy)
These use Pine Script built-in variables — only work when the alert is created from a strategy (not an indicator).
Standard Strategy Alert
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "{{strategy.order.action}}",
"quantity": "{{strategy.order.contracts}}"
}
Strategy Alert with Fixed SL/TP in Points
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "{{strategy.order.action}}",
"quantity": "{{strategy.order.contracts}}",
"stopLoss": 150,
"takeProfit": 300
}
Full Strategy Alert (all fields)
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "{{strategy.order.action}}",
"quantity": "{{strategy.order.contracts}}",
"stopLoss": 200,
"takeProfit": 400,
"id": "{{strategy.order.id}}",
"secret": "your-secret-key"
}
Alert with Secret Key
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "buy",
"quantity": 0.01,
"secret": "MySecretKey2025!"
}
The secret value must exactly match the Secret Key input in the EA settings. Signals with a wrong or missing secret are rejected
Two Separate Alerts (Manual / Indicator)
Indicators do not have {{strategy.order.action}} — create two alerts with hardcoded sides.
Alert 1 — Buy Signal
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "buy",
"quantity": 0.05,
"stopLoss": 200,
"takeProfit": 400
}
Alert 2 — Sell Signal
{
"Connect_License": "1234567890",
"symbol": "{{ticker}}",
"side": "sell",
"quantity": 0.05,
"stopLoss": 200,
"takeProfit": 400
}
PineChord EA — Input Parameters Guide
Licensing
Connect License
Input: Connect License Default: (empty)
Your unique 16-digit PineChord license key. This is provided when you purchase a subscription through the PineChord customer portal.
The EA will not process any signals unless this matches the license key attached to your MetaTrader account in our system.
Where to find it: Login to app.pinechord.com → Dashboard → your active license is displayed under your account details.
Signal API URL
Input: Signal API URL Default: https://app.pinechord.com/api/signals
Leave this as the default value
Trade Settings
Default Lot Size
Input: Default Lot Size Default: 0.01
The trade size (in lots) used when a TradingView alert does not specify a quantity. If your alert includes "quantity": 0.1, that value is used instead.
Always start with the minimum lot size (0.01) when testing.
Maximum Lot Size
Input: Maximum Lot Size Default: 10.0
A hard cap on trade size. Even if the alert sends a large quantity, the EA will never open a position larger than this value.
Acts as a safety net against accidental oversized orders.
Max Slippage (Points)
Input: Max Slippage (Points) Default: 10
Maximum acceptable price difference (in points) between the requested price and the actual execution price. If the market moves more than this between signal receipt and order submission, the trade is retried. Increase this value during high-volatility periods (e.g. news events) if trades are frequently rejected.
Note: 1 point = the smallest price increment for the instrument (e.g. 0.00001 for EURUSD with 5 decimal places).
Position Management
Position Mode
Input: Position Mode Default: No Pyramiding Options: No Pyramiding | Pyramiding | Hedging (manual close required)
Controls how the EA handles multiple signals for the same symbol.
No Pyramiding (default — recommended for most strategies)
-
Same side signal while position is open → signal ignored
-
Opposite side signal → all positions for that symbol are closed, no new position opened
-
Clean, single-position-per-symbol approach
Pyramiding
-
Same side signal while position is open → new position opened (adds to existing)
-
Opposite side signal → all positions for that symbol are closed, no new position opened
-
Use with trend-following strategies that scale into winning positions
Hedging (manual close required)
-
Any signal → new position opened regardless of existing positions
-
Both buy and sell positions can be open simultaneously on the same symbol
-
Positions must be closed manually — the EA will not auto-close hedged positions
-
Suitable for advanced hedging strategies only
⚠️ Warning: Hedging mode is for experienced traders only. Ensure your broker supports hedging (not FIFO accounts).
Reverse on Close Signal
Input: Reverse on Close Signal Default: No Options: No | Yes
Only active when Position Mode = No Pyramiding.
-
No: When an opposite side signal closes your position, no new trade is opened
-
Yes: After closing the existing position, immediately opens a new position in the direction of the incoming signal (position reversal)
Example:
Long EURUSD open → Sell signal received
Reverse OFF → Close long, done
Reverse ON → Close long, open short
Use case: Reversal strategies where each new signal should flip the position direction.
Enable Partial Close
Input: Enable Partial Close Default: No Options: No | Yes
When enabled, the EA can partially close existing positions instead of closing them fully. The percentage to close is controlled by the Default Partial Close % setting or by the partialClose field in the TradingView alert.
Default Partial Close %
Input: Default Partial Close % Default: 50.0
The percentage of the position to close when a partial close signal is triggered and no percentage is specified in the alert. For example, 50 closes half the position, 25 closes one quarter.
To specify a custom percentage from TradingView, include "partialClose": 30 in your alert message.
Max Open Positions Globally
Input: Max Open Positions Globally Default: 0 (unlimited)
Sets a hard limit on the total number of simultaneously open trades across all symbols. When this limit is reached, new signals are ignored until existing positions are closed.
Setting Effect
- 0 : No limit
- 1 : Only 1 trade open at a time
- 5 : Up to 5 trades across all symbols
Use case: Risk management — prevents overexposure during periods of many simultaneous signals.
Max Positions Per Symbol
Input: Max Positions Per Symbol Default: 0 (unlimited)
Sets a hard limit on the number of open trades per individual symbol. Useful when using Pyramiding mode to prevent unlimited stacking on a single instrument.
Setting Effect
0 No limit per symbol
1 One trade per symbol at a time
3 Stack up to 3 positions per symbol
Example: Max Positions Per Symbol = 2 with Pyramiding ON allows up to 2 buy positions on EURUSD, but blocks a third.
Trade Hours
Trade Start Time
Input: Trade Start Time Default: 00:00 Format: HH:MM (24-hour)
The earliest time the EA will execute trades each day (based on your MetaTrader local time). Signals received before this time are held and retried on the next poll — they are not discarded.
Trade End Time
Input: Trade End Time Default: 23:59 Format: HH:MM (24-hour)
The latest time the EA will execute trades each day. After this time, incoming signals are ignored until the next trading window opens.
Example: To trade only during the London session, set Start 08:00 and End 16:30.
Important: The default 00:00 to 23:59 means the EA trades around the clock. Adjust to match your strategy's intended trading hours.
Security
Secret Key
Input: Secret Key Default: (empty — disabled)
An optional shared secret between your TradingView alert and the EA. When set, the EA will only execute signals that include the matching "secret" field in the alert JSON. Signals without the correct secret are silently rejected.
TradingView alert example with secret:
{
"Connect_License": "12345678901",
"symbol": "{{ticker}}",
"side": "buy",
"quantity": 0.01,
"secret": "my-secret-key-123"
}
Recommended: Set a secret key in production to prevent unauthorised signals from being executed if your webhook URL is discovered.
SL/TP as Absolute Price
Input: SL/TP as Absolute Price Default: false (points/pips) Options: false | true
Controls how Stop Loss and Take Profit values in the alert are interpreted.
Setting SL/TP Meaning Example
false (default) Distance in points from entry price "stopLoss": 200 = 20 pips from entry
true Exact price level "stopLoss": 1.08500 = close if price hits 1.08500
Use true when your TradingView strategy outputs absolute price levels (e.g. strategy.position_avg_price - 0.0050). Use false when specifying pip/point distances.
Close Only EA Positions
Input: Close Only EA Positions Default: true Options: true | false
-
true (recommended): The EA only closes positions that it opened itself (identified by the EA's magic number). Positions opened manually or by other EAs are not affected.
-
false: The EA can close any open position for the symbol, regardless of who opened it.
Keep this set to true unless you specifically need the EA to manage manually opened positions.