PineHookPineHook

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.

License KeyDefault: (empty)#

Your unique license key from the PineHook dashboard. Required to connect.

Secret KeyDefault: (empty)#

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.

Settings SourceDefault: MetaTrader#

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#

Connection ProfileDefault: LOCAL#

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.

Default Lot SizeDefault: 0#

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.

Magic NumberDefault: 123456#

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).

Max Spread Protection (Pips)Default: 0#

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.

Max Spread Protection (%)Default: 0#

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.

Max Long LotsDefault: 0#

Maximum total long lot size per symbol. Set to 0 for unlimited.

Max Short LotsDefault: 0#

Maximum total short lot size per symbol. Set to 0 for unlimited.

Max Long % of EquityDefault: 0#

Maximum long exposure as a percentage of account equity. Set to 0 for unlimited.

Max Short % of EquityDefault: 0#

Maximum short exposure as a percentage of account equity. Set to 0 for unlimited.

When Limit ExceededDefault: Reject#

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.

Max Daily Drawdown %Default: 0#

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.

DD Reset HourDefault: 0#

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.

Recovery ModeDefault: Auto-close, notify opens#

Determines how missed signals are handled. See the options below.

Recovery Mode options:

ModeBehavior
Auto-close, notify opensAutomatically executes missed close signals but only notifies you about missed opens. (Default, Recommended)
Notify OnlyThe safest option. Logs missed signals but takes no action. You handle them manually.
Signal Expiry WindowDefault: 15 minutes#

Maximum age of a missed signal before it is ignored. Options: 5 min, 15 min, 30 min, 1 hour.


Symbol Filtering#

Symbol Filter Mode#

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.

CommandEffect
eaoff,SYMBOLAdds a symbol to the blacklist, or removes it from the whitelist.
eaon,SYMBOLRemoves a symbol from the blacklist, or adds it to the whitelist.
eaoff,ALLSwitches to whitelist mode with an empty list, disabling all symbols.
eaon,ALLSwitches to blacklist mode with an empty list, enabling all symbols.
eaoffexcept=SYM1;SYM2Switches to whitelist mode with only the listed symbols enabled.
eaonexcept=SYM1;SYM2Switches to blacklist mode with only the listed symbols disabled.
Block Manual Trades on Filtered Symbols#

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.

Enable Active Hours FilterDefault: false#

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.

Active Hours StartDefault: 08:00#

Start of the trading window in HH:MM format.

Active Hours EndDefault: 20:00#

End of the trading window in HH:MM format.

TimezoneDefault: Server#

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).

Close Positions Outside Hours#

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#

Log VerbosityDefault: Normal#

Controls how much the EA writes to the Experts tab.

Log levels:

LevelWhat's logged
NormalTrades, important events, and errors. (Default, Recommended)
DebugEverything 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:

  1. Signal parameters (highest priority)
  2. EA default settings
  3. 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:

  1. Click OK to apply
  2. The EA will restart and reconnect
  3. 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.