BarFlip Trail
- Experts
- Versione: 1.62
- Attivazioni: 5
BarFlip Trail EA — Intrabar Flip Entry with Trailing Stop (XAUUSD H4)
BarFlip Trail EA watches the price action inside the current candle and enters at the moment the price flips direction relative to the candle's open price. The default settings are optimized for XAUUSD on the H4 timeframe.
HOW IT WORKS
• BUY: during the current bar, price first moves below the bar's open, then crosses back above it. The EA buys at that moment.
• SELL: during the current bar, price first moves above the bar's open, then crosses back below it. The EA sells at that moment.
• A "Reverse entry" option inverts these directions, so you can trade against the flip instead.
• Positions are managed by a trailing stop. No fixed take profit is used.
• By default, any position still open when the next bar starts is closed.
The EA evaluates signals tick by tick, so it reacts inside the candle and does not wait for the bar to close.
KEY FEATURES
• Intrabar flip entry based on the current bar's open price
• Bar formation filter: skip the early part of a new bar so the EA does not enter right after the candle opens
- Minimum elapsed % of the bar
- Minimum bar range (High-Low) in points
• Trailing stop with adjustable start, distance and step
• Force close when the next bar starts (optional)
• Opposite signal close, with an option to reverse the position (optional)
• Daily profit panel: Daily profit $ (realized and floating) shown on the chart
• Daily profit target: the EA stops trading for the rest of the day when the target is reached (optional full close)
• Optional stop loss using the current bar's High/Low
• Spread filter, one-entry-per-bar option, BUY/SELL enable switches
• Flip buffer to filter noise around the open price
INPUT PARAMETERS
Basic Settings
• InpLots — lot size
• InpMagic — magic number
• InpSlippage — maximum slippage (points)
• InpMaxSpreadPoints — maximum spread (0 = no limit)
• InpComment — order comment
Entry Settings
• InpCrossBufferPoints — buffer around the bar open to confirm a flip
• InpOneTradePerBar — allow only one new entry per bar
• InpAllowBuy / InpAllowSell — enable or disable each direction
• InpIgnoreFirstBarTick — skip the bar in progress at startup
• InpReverseEntry — invert the entry direction
Bar Formation Filter
• InpMinElapsedPercent — minimum % of the bar that must have elapsed before entry (0 = off)
• InpMinBarRangePoints — minimum bar range in points before entry (0 = off)
Close on New Bar
• InpCloseOnNewBar — force close positions opened before the current bar
Opposite Signal Close
• InpUseOppositeClose — close the position on an opposite signal
• InpReverseOnOpposite — open a new position in the opposite direction after closing (false = close only)
Daily Profit
• InpDailyProfitTarget — daily profit target in account currency (0 = off)
• InpIncludeFloating — include floating P/L in the daily profit
• InpCloseOnTarget — close all positions when the target is reached
• InpShowPanel — show the on-chart panel
Stop Loss
• InpUseBarSL — use the current bar's Low (BUY) or High (SELL) as the stop loss
• InpSLBufferPoints — extra buffer for that stop loss
Trailing Stop
• InpUseTrailing — enable the trailing stop
• InpTrailStartPoints — profit (points) required before trailing starts
• InpTrailDistancePoints — distance between price and the stop loss
• InpTrailStepPoints — minimum step to move the stop loss
RECOMMENDED SETTINGS
• Symbol: XAUUSD (Gold)
• Timeframe: H4
• Parameters: the default values are already optimized for XAUUSD H4. You can run the EA with the defaults.
• Account type: Netting or Hedging
• Minimum deposit: [$1000]
• Run the EA on one chart per symbol with a unique magic number.
IMPORTANT NOTES
• All distance inputs are in points. The default values are set for brokers that quote XAUUSD with 2 digits (1 point = 0.01). If your broker quotes XAUUSD with 3 digits, multiply the point-based inputs by 10.
• By default the EA does not place a stop loss (SL = 0). The stop loss is set by the trailing stop only after the position reaches the trailing start profit. Until then, a position can stay open with unlimited loss unless it is closed by the new-bar close, the opposite signal or manually. Use a suitable lot size, or enable InpUseBarSL, to control risk.
• The daily profit and the daily target are calculated only from trades of this EA (same magic number and symbol). Manual trades and other EAs are not included.
• The "day" is based on the broker's server time (start of the D1 bar).
• Signals are generated from intrabar price movement. For backtesting, use "Every tick" or "Every tick based on real ticks". Other modes will not reproduce the behavior correctly.
• Optimization is based on historical data. Results depend on the broker, spread, execution speed and market conditions, and may differ in live trading. Test on a demo account before trading live.
• Check your broker's STOPS_LEVEL and spread. Gold spreads can widen during news and rollover, which affects the trailing stop and entries.
RISK WARNING
Trading Forex, gold, CFDs and other leveraged products involves a high level of risk and may not be suitable for all investors. Past performance, including backtests and optimization results, does not guarantee future results. Only trade with money you can afford to lose.
