Skip to content
All library documents

AK-47 Scalper: Timed Sell Stops with Spread and Trailing Controls

Article MQL5 code base

Summary

This MetaTrader expert advisor places sell-stop orders during a configurable trading window. It checks whether trading is allowed and screens orders against a maximum spread, then sets the pending entry below the bid with a stop loss above the ask. The code does not define a take-profit target. It uses a fixed lot size or estimates volume from free margin and a risk-percentage input, with minimum and maximum lot constraints.

The advisor updates existing trades and trails stop losses as prices move, handling active sell positions and pending sell-stop orders separately. It also converts pip values and slippage according to instrument digit precision. The document supplies implementation details but no test results, market rationale for the sell signal, or evidence of profitability. Its sizing formula is a margin-based calculation rather than a clearly specified loss-at-stop risk model, and the narrow stop distance and spread limits may behave differently across brokers and instruments.

Key ideas

  • The advisor submits sell-stop orders only within an optional daily time window.
  • A maximum-spread check can prevent order submission when trading costs exceed the configured limit.
  • Stop-loss levels are placed above the market, with trailing adjustments for both open sells and pending sell stops.
  • Position size can be fixed or estimated from free margin, then bounded by broker lot limits.
  • The document provides no backtest or live-performance evidence for the approach.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.