QuantForge
en

Block reference

Each block behaves the same in the exported EA and in the Strategy Tester. Numeric settings can be linked to inputs. Distances are in pips: on 5- and 3-digit quotes one pip is 10 points.

Checks

These have a YES and a NO output.

Once Per Bar

Passes on the first tick of each new bar of its timeframe (the chart’s, unless you pick another). Each Once Per Bar block tracks its own bar, so two of them both pass on a new bar. Put one in front of your entries so the EA trades at most once per bar instead of on every tick.

Condition (If A vs B) and Crossover

Compare two operands: an indicator, a price or a fixed value. Candle shift picks the bar: 1 is the last closed bar (the usual choice), 0 the bar still forming.

  • Operators: greater/less than, greater/less or equal, equals.
  • Crosses above: A was at or below B one bar earlier and is above it now. Crosses below is the mirror.
  • Indicators: RSI, EMA, SMA, ATR and CCI (with their period); Bollinger bands (2.0 deviations); Envelopes (0.25%); Keltner lower band (EMA − 1.5 × ATR(14)); VWAP band; MACD main and signal (12, 26, 9); Stochastic %K (5, 3, 3). The Timeframe setting reads them on another timeframe.

Time / Session Filter

Passes when the server hour is at or after the start hour and before the end hour.

Max Spread Filter

Passes while the current spread, in points, is at or below the limit.

Check Open Trades Count

Passes while this EA has at most the given number of open positions in the chosen direction (ANY, BUY or SELL). Pending orders don’t count.

Daily Drawdown Guard

Compares equity with the balance at the start of the server day. While the loss is under the limit it takes YES. When the limit is reached it closes all positions (if close all on breach is ticked) and takes NO for the rest of the day.

Martingale / Grid Multiplier

Lets the first order of a grid through: when no position is open it passes and the next order uses its own lot. After that it passes only when the newest position is at least step pips in loss and fewer than max orders positions are open. The next order then uses that position’s lot × multiplier. Grids add exposure as price moves against you, so test them carefully.

Orders and positions

Buy Now / Sell Now

Opens a market order. Lots are either fixed or sized from a risk % of equity over the stop loss. Stop loss and take profit are set in pips from the entry price; a value of 0 falls back to 30 and 60 pips.

Pending Buy/Sell Stop

Places a BUY STOP, SELL STOP, BUY LIMIT or SELL LIMIT order the offset away from the current price. Stop loss and take profit are measured from the order’s price. Expiration in minutes deletes the order if it hasn’t filled; 0 keeps it until filled.

Close Trades

Closes this EA’s open positions in the chosen direction (ALL, BUY or SELL). Pending orders are left alone.

Trailing Stop

Once a position is start pips in profit, moves its stop loss to distance pips behind the price, in steps of at least step pips. Works for buys and sells.

Move to BreakEven

Once a position is trigger pips in profit, moves its stop loss to the entry plus lock pips. It never loosens a stop.

Risk % Lot Calculator

Sizes the orders placed after it on the same tick: risk % of equity divided by each order’s stop loss (or the default stop when an order has none), kept between the min and max lot. Without it, each order keeps its own lot setting.

Logic and output

Pass / Connector

Does nothing; useful to merge or tidy paths.

Draw Arrow

Draws an arrow on the chart, at most once per bar per block: below the low for up/buy arrows, above the high for down/sell arrows. Arrows also appear on the Strategy Tester chart.

Send Alert / Push Notify

Sends the message as a terminal alert, a push notification to the MetaTrader mobile app, both, or only to the Experts log.