EA Configuration
Every PineHook EA input parameter, grouped by function, plus the difference between MetaTrader mode and Dashboard mode and where each setting is read from.
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. This choice is final: nothing on the platform can change it remotely, and only the person at the terminal can switch it.
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) is 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 is 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 and prevent over-leveraging on a single instrument. They apply to the license you set them on, and they are counted per symbol, per magic number.
How the limits are counted
Each limit is measured against the exposure held by one magic number on one symbol, not against everything open on that symbol.
In Single Magic Number Mode every trade shares your default magic, so this is simply your total exposure on the symbol. In Multi-Strategy mode each strategy has its own magic, so each strategy gets its own allowance: three strategies on EURUSD with a 1-lot cap can hold up to 3 lots between them. Set the cap to the amount you want any one strategy to hold.
Netting and Exchange accounts are always forced to Single mode (they keep one net position per symbol, so magic numbers cannot isolate strategies), which makes per-magic and per-symbol the same thing there.
Maximum long lot size for one magic number on one symbol. Set to 0 for unlimited.
Maximum short lot size for one magic number on one symbol. Set to 0 for unlimited.
Maximum long exposure for one magic number on one symbol, as a percentage of account equity. Set to 0 for unlimited.
Maximum short exposure for one magic number on one symbol, 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#
Drawdown protection acts when your account equity drops too far below a reference level.
There are two separate limits, and you can run either one or both:
- Max Daily Loss caps what you can lose in a single day. It resets every day at the hour you choose, and you can set it as a percentage or as a cash figure.
- Max Overall Drawdown caps how far the account can fall in total. It does not reset, and you choose how it is measured.
Running both is what prop firms require. Almost every firm enforces a daily loss and a maximum drawdown at the same time, and breaching either one ends the account, so protecting only one of them leaves the other exposed. Set each to your firm's figure and the EA stops you before they do.
Whichever limit trips first blocks the account. The EA chart panel and the Experts log name the one that fired, so you always know which number stopped you and when it lifts.
How much the account may lose in one day before the EA blocks new trades.
Read as a percentage or as a cash amount depending on Limit Unit, so you can enter your firm's figure exactly as they state it. 3 with the unit on % means three percent of the day's starting equity; 3000 with the unit on $ means three thousand of your account currency.
The day starts at DD Reset Hour in broker time, and the starting figure is the higher of your equity and your balance at that moment. That is the rule FTMO, BrightFunded, The5ers and FundedNext all use, so our floor lands on the same scale as your firm's and any margin you leave is the margin you actually get. Worth knowing when you choose your figure: entering your firm's exact percentage puts this floor on the very level at which they act, and the EA samples once a second and waits for three consecutive readings before it does anything. Whether to leave yourself a margin, and how much, is your decision. The practical consequence is worth understanding: if you hold a winner through the reset hour, that unrealised profit becomes part of your starting figure, so handing it back counts against your day. Your firm counts it that way too.
Set to 0 to disable.
This limit resets every day whatever your Drawdown Mode is. A block it raised lifts at the next reset hour, and a block raised by the overall limit does not.
Not available in End of Day mode, because that mode already measures the day. If you want both a daily and an overall limit, choose one of the other four modes for the overall one.
How far equity may fall below the reference level before the EA acts, as a percentage or as a currency amount depending on Limit Unit below. What the reference level is depends on Drawdown Mode. Set to 0 to disable; the dashboard also offers this as an on/off switch that remembers your last value.
Separate from the daily loss limit above, and the two run happily together.
While a block is active the EA also cancels its own pending orders, because an order placed before the breach could otherwise fill and open a new position while you are blocked. Manual orders are untouched. Cancelled pending orders are not restored, so re-send the entry signals if you still want them.
How the reference level is measured. Five options:
| Mode | Reference level | Moves? |
|---|---|---|
| End of Day | Your equity at the reset hour each day | Re-anchors daily |
| Trailing (floating) | The highest equity you have ever reached, including unrealised profit on open trades | Only up |
| Trailing (closed) | The highest balance from closed trades only | Only up |
| Static | Your equity when you switched the mode on, or your override | Never |
| Relative | A percentage of your highest account value | Only up |
End of Day is the default and is the behaviour PineHook has always had.
The two trailing modes keep a fixed dollar distance behind your peak. If you start at $100,000 with a 5% limit, the distance is $5,000 and stays $5,000, so at a $108,000 peak your floor is $103,000. The difference between them is what counts as a peak. Trailing (floating) counts a trade that runs to +$3,000 while still open, so giving that profit back can trip the limit. Trailing (closed) only counts profit you actually banked, so a trade that runs up and closes at breakeven never moves your floor.
Relative keeps a fixed percentage instead, so the distance grows with the account: at a $100,000 peak your floor is $95,000, and at a $200,000 peak it is $190,000.
In practice the trailing modes get stricter as the account grows. Five percent of $100,000 is a $5,000 buffer, and it is still a $5,000 buffer at a $200,000 peak, which works out to 2.5%. That is the prop-firm style. Relative keeps risk proportional to size: the buffer stays 5% of the peak, so it doubles when the account doubles.
The three peak modes climb without limit unless you set a Lock Floor At Profit %, described next.
Stops a trailing floor from rising once you are far enough ahead, then freezes it there for good. 0 turns it off, which is how the three peak modes have always worked.
Many prop firms measure this way. The floor follows your equity up only until the account is a set percentage in profit, and from that point it never moves again, usually settling exactly on your starting balance. FTMO works like this, and so do BrightFunded's 1-Step and Alpha Capital, both of which lock at 6%.
To reproduce that, set this to the same number as your Max DD. On a $100,000 account with a 6% limit and a 6% lock, the floor trails up to $100,000 as your equity reaches $106,000, and then stays at $100,000 however high the account climbs.
| Equity | Floor without a lock | Floor with a 6% lock |
|---|---|---|
| $103,000 | $97,000 | $97,000 (still trailing) |
| $106,000 | $100,000 | $100,000 (locks here) |
| $130,000 | $124,000 | $100,000 |
- It applies to the three peak modes only. End of Day and Static have no peak to freeze, so the setting is ignored there and the dashboard hides it.
- In Relative mode, matching the lock to your Max DD does not land the floor exactly on your starting balance, because Relative's distance is a percentage of the peak rather than a fixed amount. With a 6% limit and a 6% lock the floor settles about 0.36% below your starting balance. Use one of the two trailing modes if you need it to sit exactly on the balance.
Do not try to imitate this with Static mode. Static measures down from your baseline, so pinning a $100,000 baseline with a 6% limit puts the floor at $94,000, which is $6,000 lower than the firm's and leaves you unprotected in exactly the situation you were guarding against.
What the EA does when the limit is hit:
- Block new trades refuses new entries. Open positions are left alone.
- Close everything closes all positions and cancels all orders, then resumes trading.
- Close and block closes everything and also refuses new entries.
Close actions are unfiltered by magic number: everything in the terminal is closed, on the basis that a drawdown limit sparing half your exposure is not a limit.
Applies to both limits. Whether each number is read as a percent of its own reference level or as a fixed amount in your account currency. With percent (the default and the historical behaviour), 5 means 5% below the reference. With currency, 2000 means the guard trips 2,000 account-currency units below the reference, which is your equity at anchor time, the high-water mark in the moving modes, or the declared level if the override is set.
One consequence worth knowing: in currency mode every mode keeps a fixed amount, so Relative behaves the same as Trailing (floating). The elastic percentage gap is Relative's whole difference, and a currency limit removes it.
How many seconds in a row your equity must stay past the limit before the EA acts. The guard reads equity once per second, and a single reading can lie: a spread blowout or a bad tick moves marked-to-market equity for a moment without any real loss. The default of 3 filters those out.
Set it to 1 only if you need the fastest possible reaction and accept the risk: at 1 the guard acts on a single reading, bad ticks included. Traders running close to an external hard limit usually do better keeping 3 here and setting their threshold with some margin instead.
Hour (0-23) in MT5 server (broker) time when the trading day rolls over: the daily loss baseline re-anchors and any block it raised lifts. The default of 0 means midnight.
Broker time is the Market Watch clock in MT5, and it is often hours away from the clock on your computer. The timestamp column in the Journal and Experts tabs is your computer's clock, not the broker's, so don't set this hour from there. The EA also prints the broker time in every Authentication successful line.
Used by Max Daily Loss in every mode, and by End of Day mode for its own baseline. It is hidden and ignored only when neither of those is active.
The level your account started at. If your account sits at $49,875 but your firm treats it as a $50,000 account, set this to 50000 and the guard measures from that.
Because the starting level is also the account's opening high point, each mode uses it accordingly. Static pins the floor to it permanently. Relative and the trailing modes start their high-water mark from it and trail above it once your account genuinely exceeds it, and in the trailing modes it also sizes the fixed dollar gap (5% of the declared $50,000, not of whatever your floating P&L showed at the moment you saved). A value below your current equity does nothing in the moving modes, because your real high already exceeds it.
End of Day ignores this field and logs that it did, because it re-anchors from live equity every day, so a fixed level has no meaning there. The dashboard greys the field out in that mode. Set to 0 to use live equity at the moment the guard is armed.
Safety by Design
Once the drawdown limit is hit, raising the percentage will not unblock trading. This is intentional and prevents overriding the safety net during a losing streak.
How the block lifts depends on the mode:
- In End of Day mode, trading resumes automatically at the next reset hour.
- In every other mode there is no daily reset, so the block holds until you change the drawdown mode, the percentage, or the equity override. Any of those re-anchors the guard at your current equity and clears the block.
Setting the percentage to 0 disables the feature and clears the block in every mode.
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.
Broker Symbol Mapping#
Translates TradingView's instrument names into your broker's, for accounts where the two differ (EURUSD against EURUSD.micro, or US30 against DJ30). All three fields default to empty, and empty means no translation happens, so most accounts leave this alone.
| Setting | Example | Effect |
|---|---|---|
| Prefix | i. | Added to the front of every symbol |
| Suffix | .micro | Added to the end of every symbol |
| Renamed instruments | US30 to DJ30.r | Replaces the whole symbol, skipping the affixes |
Configure it in whichever source your Settings Source names: the dashboard in Dashboard mode, the EA inputs in MetaTrader mode. The other source is ignored rather than merged. A per-license mapping replaces the account one as a group, so a license that sets only a rename also drops the account prefix and suffix.
Full guide, including how to tell whether you need it: Broker Symbol Mapping.
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."
News Filter#
Holds new entries in a window either side of a high-impact economic release, where spreads widen and fills slip. The calendar comes from the server and is visible on the News page of your dashboard, so you can see in advance which releases would hold an alert.
Closes and cancels always run, whatever else you configure here. A rule about volatility should never stop you leaving a position.
The master switch. With it off nothing below has any effect.
The minutes before and after a release are set independently, so 5 and 60 is a valid asymmetric window. Each side accepts 0 to 240 minutes, where 0 means no window on that side rather than a default.
High-impact (red) releases always count when the filter is on. Medium-impact (orange) is an opt-in checkbox. Low impact never counts, because a guard that stands down for every minor print stands down permanently.
By default every symbol is guarded. You can narrow it to a named list, and that is the case you have to type out, because an empty list means all symbols rather than none.
Widens the window from "no new entries" to "no stop or target changes either". Off by default, which keeps the behaviour the filter has always had.
With it on, for the length of the window:
modify,breakeven,nobreakeven,trailandnotrailalerts are refused, and show in your Signal Logs as blocked by the news filter.- The EA's own trailing and auto-breakeven passes pause, so your stops sit still rather than being walked by automation. They are paused rather than cancelled, so the moment the window ends they pick up again, and they fire straight away if the price has already passed the trigger.
- A partial close that would move the remainder's stop to breakeven still closes, but leaves the stop where it is.
Turn it on if your firm treats a stop moving inside a news window as a breach. Several do. Leave it off if you would rather your trailing stop kept working through the release.
This stops your levels being moved. It cannot stop the market from reaching a stop that is already sitting on your account. If your firm counts that as a breach, look ahead at the calendar and plan around releases that sit near your open positions, because no setting will solve it for you.
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.