EA Configuration
Complete reference for all PineHook EA input parameters.
When you attach the PineHook EA to a chart, a settings dialog appears with the Inputs tab. This page documents the most commonly used parameters, grouped by function.
Two Modes
The EA supports two settings modes. In MetaTrader mode (default), you configure everything on MetaTrader. In Dashboard mode, most settings are fetched from your web dashboard instead. License Key, Secret Key, Settings Source, Connection Profile, and Magic Number Mode are always read from the EA inputs. Learn more about Dashboard mode →
License & Authentication#
These are always required regardless of settings mode.
Your unique license key from the PineHook dashboard. Required to connect.
Optional extra authentication. If you generated a Secret Key for your license, enter it here. The EA cannot connect without it when one is set. Leave blank if not using one.
Choose where the EA reads its configuration from. MetaTrader uses the values as set on MetaTrader directly. Dashboard fetches settings from your web dashboard and can be updated in real-time on the PineHook website. Useful if you want to change your settings without needing access to your MetaTrader instance.
Keep Your License Key Secure
Your license key authenticates your EA connection. Do not share it or include it in public Pine Script code.
Connection#
Tunes how the EA keeps its connection to PineHook alive, based on the kind of machine it runs on.
- LOCAL (default) — Best for a home computer, laptop, or Wi-Fi connection. It is more tolerant of brief network blips and of the machine sleeping and waking, so the EA doesn't disconnect unnecessarily on a typical personal setup.
- VPS — Best for an always-on server (such as a VPS) on a stable, wired connection. It notices a dropped connection and brings the EA back online faster, which suits a setup meant to run 24/7.
If you're unsure, leave this on LOCAL. Only switch to VPS when you run MetaTrader 5 on a dedicated, always-on server.
Trading Settings#
These parameters control trade execution.
Lot size used when a signal does not include size_lots or size_pct. Setting this to 0 requires every signal to specify its own size, which is recommended.
Unique identifier for trades opened by this EA. Use different magic numbers if running multiple strategies on the same symbol and license (requires a HEDGING account from your broker).
Maximum spread in pips/ticks allowed when opening a trade. Trades are rejected if the current spread exceeds this value. Set to 0 to disable. Can also be overridden per-signal with maxspread_pips.
Maximum spread as a percentage of the current price allowed when opening a trade. Useful for instruments with very different price levels. Set to 0 to disable. Can also be overridden per-signal with maxspread_pct.
Position Limits#
These settings cap your exposure per symbol and prevent over-leveraging on a single instrument.
Maximum total long lot size per symbol. Set to 0 for unlimited.
Maximum total short lot size per symbol. Set to 0 for unlimited.
Maximum long exposure as a percentage of account equity. Set to 0 for unlimited.
Maximum short exposure as a percentage of account equity. Set to 0 for unlimited.
Determines what happens when a trade would exceed a limit. Reject blocks the trade entirely. Cap reduces the lot size to fit within the limit.
Risk Management#
Daily drawdown protection blocks all new trades if your account equity drops too far in a single day.
Maximum allowed equity drop from the day's starting equity, as a percentage. All new trades are blocked once this threshold is reached, until the next reset. Set to 0 to disable.
Hour (0-23) in MT5 server (broker) time when the drawdown counter resets and trading resumes. The default of 0 means midnight.
Safety by Design
Once the drawdown limit is hit, raising the percentage from the dashboard will not unblock trading mid-session. This is intentional and prevents overriding the safety net during a losing streak. Trading resumes automatically at the next reset hour. The only way to override mid-session is setting the value to 0, which fully disables the feature.
Signal Recovery#
These settings control what happens when the EA reconnects after being offline and finds missed signals.
Determines how missed signals are handled. See the options below.
Recovery Mode options:
| Mode | Behavior |
|---|---|
| Auto-close, notify opens | Automatically executes missed close signals but only notifies you about missed opens. (Default, Recommended) |
| Notify Only | The safest option. Logs missed signals but takes no action. You handle them manually. |
Maximum age of a missed signal before it is ignored. Options: 5 min, 15 min, 30 min, 1 hour.
Symbol Filtering#
The EA supports two filter modes for controlling which symbols it can trade:
- Blacklist (default): All symbols are enabled except those on the list.
- Whitelist: Only the symbols on the list are enabled. Everything else is blocked.
The filter mode and symbol list are managed from the dashboard or via the webhook commands below.
| Command | Effect |
|---|---|
eaoff,SYMBOL | Adds a symbol to the blacklist, or removes it from the whitelist. |
eaon,SYMBOL | Removes a symbol from the blacklist, or adds it to the whitelist. |
eaoff,ALL | Switches to whitelist mode with an empty list, disabling all symbols. |
eaon,ALL | Switches to blacklist mode with an empty list, enabling all symbols. |
eaoffexcept=SYM1;SYM2 | Switches to whitelist mode with only the listed symbols enabled. |
eaonexcept=SYM1;SYM2 | Switches to blacklist mode with only the listed symbols disabled. |
When enabled, the EA will also close manually-opened trades on symbols that are filtered out, in addition to blocking signal-based trades.
This is a Dashboard-managed setting (default off). It is not exposed as a MetaTrader input, so in MetaTrader settings mode it stays off.
Active Hours#
These settings restrict when the EA can open new positions based on time of day. Close, cancel, and trade-management signals always run regardless of active hours, so you can exit or adjust an open position even after the close hour passes.
Turns the time filter on or off. While active hours are enabled, entry signals are blocked outside the window, but close, cancel, and trade-management signals always run.
Start of the trading window in HH:MM format.
End of the trading window in HH:MM format.
The clock reference to use. Server uses MT5 broker time, UTC uses coordinated universal time, and Local uses your computer's time (or the server's time if running MT5 in a VPS).
When enabled, the EA closes all positions and cancels pending orders the moment active hours end.
This is a Dashboard-managed setting (default off). It is not available as a MetaTrader input, so in MetaTrader settings mode it stays off.
Overnight Sessions
The EA handles sessions that cross midnight. Setting start to 22:00 and end to 06:00 means "active from 10 PM tonight until 6 AM tomorrow."
Logging#
Controls how much the EA writes to the Experts tab.
Log levels:
| Level | What's logged |
|---|---|
| Normal | Trades, important events, and errors. (Default, Recommended) |
| Debug | Everything in Normal plus detailed diagnostics: signal parsing, reconciliation, and connection internals. Use for troubleshooting. |
Settings Priority#
When a signal includes parameters, they override EA defaults:
- Signal parameters (highest priority)
- EA default settings
- Broker defaults (lowest priority)
For example, if your EA has Default Lot Size: 0.1 but the signal specifies size_lots=0.05, the trade will use 0.05 lots.
Applying Settings#
After changing settings:
- Click OK to apply
- The EA will restart and reconnect
- Check the Experts tab for confirmation
Quick Access
To reopen the EA's Inputs at any time, either double-click the blue EA icon (the small "hat") in the chart's top-right corner (the icon next to the name, not the name text), or right-click the chart → Expert List, select PineHook, and click Properties. The settings are on the Inputs tab.
Next Steps#
See the Creating Alerts guide to set up your first TradingView webhook alert.