Scalper User Guide

Table of Contents

  1. Overview and Features

    • Key Features
  2. Installation and Settings

    • Installation
    • Settings
      • Tick Density
      • Tick Velocity
      • Tick Acceleration
      • Tick Direction
      • Tick Moving Average
      • Average Bar Height Filter
      • Buy/Sell Signal Control
      • Signal Condition Logic
  3. Using the Indicator

    • Understanding the Display
    • Live Tick Panel
    • Signal Conditions
    • Signal Generation Logic
    • Practical Application
    • Reading Signal Strength
  4. Advanced Usage and Strategy Integration

    • Signal Engine Architecture
    • Real-Time Filters
    • Signal Voting and Filtering
    • Technical Indicator Buffers
    • Encoded Signal Storage
      • Signal Bit Structure
      • Buffer Allocation
    • Signal Manager System
    • Automation with EAsiTrader
    • Strategy Applications
  5. Signal Retrieval for EAsiTrader Integration

    • How EAsiTrader Reads Scalper Signals
    • Accessing Signals in Custom EAs
  6. Insights

    • Understanding Signal Quality
    • Market Microstructure Patterns
    • Detecting Momentum and Exhaustion
    • Using Scalper for Entry and Exit Timing
    • Practical Trading Examples
    • Fine-Tuning for Different Instruments
    • Summary Tips
  7. Creating Custom Scalper Strategies in EAsiTrader

  8. Glossary

    • Tick-Based Terminology
    • Signal Components
    • Buffer Terminology
    • Encoding Concepts
    • Trading Terminology
    • Technical Terms

1. Overview and Features

The Scalper Indicator is a sophisticated real-time signal engine designed for precision tick-based trading. Unlike traditional indicators that rely on completed candles or fixed-time calculations, Scalper analyzes every incoming tick to detect micro-imbalances in price, pressure, direction, and volatility—the critical moments that scalpers aim to capture.

At its core, the indicator processes tick-level market microstructure through five advanced components:

  1. Tick Density - Measures the concentration of ticks within a configurable time window, identifying periods of heightened market activity and potential breakout conditions.

  2. Tick Velocity - Calculates the speed of price movement in points per millisecond, detecting rapid directional shifts before they become visible on traditional charts.

  3. Tick Acceleration - Tracks changes in velocity, providing early warning of momentum building or waning.

  4. Tick Direction - Analyzes the directional bias of recent ticks, identifying when market participants are predominantly buying or selling.

  5. Tick Moving Average - Computes a tick-based moving average and measures deviation from this mean, identifying stretches and potential mean reversion opportunities.

The Scalper Indicator combines these components through a customizable rule-based engine to trigger precise signals the moment conditions align. Its primary purpose is not visual chart analysis but rather to power automated trading systems like EAsiTrader for live execution or EAsiTrader Tester for tick-accurate backtesting.

Key Features

  • Real-Time Tick Evaluation
    Signals are calculated on every tick, not every bar—providing scalpers with an up-to-the-millisecond edge over traders relying on candle-based indicators.

  • Adaptive Normalization
    Automatically normalizes metrics based on recent market conditions, ensuring consistent performance across varying volatility environments.

  • Modular Microstructure Metrics
    Five independent systems measure tick-based density, speed, acceleration, direction, and MA deviation, each with customizable parameters.

  • Custom Signal Logic via Bitmaps
    Define which conditions must be met to trigger a signal using bitmap logic, and which metrics determine whether it’s bullish or bearish—giving you complete control over signal generation.

  • Robust Signal Filtering
    Filter out noise and low-quality setups with:

    • Average Bar Height (ABH) minimums
    • Time-based signal spacing
    • Strength thresholds for each metric
  • Encodes Multiple Signals Per Bar
    Uses compressed buffer encoding to store up to six signals per bar with precise timestamp offsets, providing accurate signal replay for backtesting.

  • Live Tick Panel
    Optional real-time dashboard showing current metric values and threshold status, updating on every tick for immediate visual feedback.

  • Full EAsiTrader Integration
    Seamlessly interfaces with EAsiTrader EA and Tester, allowing direct consumption of signals without additional coding.

The Scalper Indicator is engineered for one specific purpose: detecting actionable price movements in real-time and delivering them instantly to your strategy logic for execution advantage in fast-moving markets.

2. Installation and Settings

The Scalper Indicator is designed to run in real time, processing each tick as it arrives. Once added to a chart, it immediately begins calculating signal metrics and broadcasting live signals for automated systems like EAsiTrader.

Installation

  1. Prepare Directory Structure
    Create the folder structure MQL5\Indicators\NTL in your MetaTrader data directory if it doesn’t already exist.

  2. Install Required Files
    Copy the following files to their appropriate locations:

    • Scalper.ex5MQL5\Indicators\NTL\
  3. Apply to Chart

    • Open MetaTrader and navigate to the Navigator panel
    • Expand the Indicators section and find NTL → Scalper
    • Drag the indicator onto your desired chart or double-click to apply
    • Configure the settings in the dialog that appears
  4. Verify Operation
    After applying, you should see the indicator in a separate window below your main chart, displaying three lines:

    • Red line: Tick Density
    • Green line: Tick Velocity
    • Blue line: Tick Acceleration

    Additionally, a live signal panel should appear in the top-left corner, displaying current values and threshold status for each metric.

  5. Optional: Save Template
    Save your chart layout as a template for future use:

    • Right-click on the chart → Templates → Save Template
    • Enter a name like “Scalper_Setup” and click Save

Note: For optimal performance with tick-based analysis, ensure your broker provides high-quality tick data with minimal latency. The indicator performs best on liquid instruments with consistent tick flow and low-latency data feeds. Higher latency connections may reduce the effectiveness of real-time signal detection, especially for very short-term scalping.

Settings

The Scalper Indicator includes numerous grouped settings that control how it detects signals, filters noise, and outputs data. Each group relates to a specific part of the signal engine.

EA Flag

  • Indicates the indicator was created by an EA. Set this value to 1 when loading the indicator from an EA, eg. IndicatorCreate

Tick Density

  • Tick Density Window in Ms (default: 10000)
    Time window used to count ticks, in milliseconds. Controls the lookback period for measuring market activity.

    • Smaller values (3000-5000): More responsive, suitable for very short-term scalping
    • Larger values (10000-20000): More stable, reduces false signals
    • Example: A setting of 10000 counts ticks within a 10-second rolling window
  • Tick Density Signal Threshold (default: 0.7)
    Normalized value (0–1) determining how active the market must be to consider the density condition met.

    • Higher values (0.7-0.9): Only triggers during very active market periods
    • Lower values (0.3-0.5): More sensitive, identifies subtle activity increases
    • Note: If set to 0, this condition is always considered met and effectively ignored in signal generation
    • Example: A setting of 0.7 requires the current tick density to reach at least 70% of the normalized maximum

Tick Velocity

  • Tick Velocity Window in Ms (default: 10000)
    Time window for measuring price movement speed, in milliseconds.

    • Example: A 5000ms setting calculates velocity over a 5-second period
  • Tick Velocity Smoothing (default: 0.3)
    Exponential smoothing factor (0-1) applied to velocity calculations.

    • Higher values: More weight to current readings, faster response
    • Lower values: More smoothing, less noise
    • Example: With 0.3, each new velocity reading contributes 30% to the final value
  • Tick Velocity Signal Threshold (default: 0.6)
    Normalized minimum speed required to activate the velocity condition (-1 to +1).

    • Example: Setting of 0.6 means velocity must reach 60% of the normalized range
    • Note: If set to 0, this condition is always considered met regardless of actual velocity

Tick Acceleration

  • Tick Acceleration Window in Ms (default: 10000)
    Time window for measuring how fast velocity is changing.

  • Tick Acceleration Smoothing (default: 0.5)
    Smoothing factor for acceleration calculations.

  • Tick Acceleration Signal Threshold (default: 0.3)
    Minimum acceleration required to trigger the acceleration condition (-1 to +1).

    • Note: If set to 0, this condition is always considered met regardless of actual acceleration
    • Example: Setting of 0.3 means acceleration must reach 30% of the normalized range

Tick Direction

  • Tick Direction Window in Ms (default: 10000)
    Time window for measuring the directional bias of ticks.

  • Tick Direction Signal Threshold (default: 0.7)
    Value from 0 to 1 indicating how strong the directional bias must be.

    • Example: 0.7 means at least 70% of ticks within the window must move in the same direction
    • Note: If set to 0, this condition is always considered met regardless of actual tick direction

Tick Moving Average

  • Tick MA Period (default: 10)
    Number of ticks used in the moving average calculation.

  • Tick MA Method (default: TICK_MA_EXPONENTIAL)
    The type of moving average to use:

    • 0: Simple Moving Average (SMA)
    • 1: Exponential Moving Average (EMA)
    • 2: Weighted Moving Average (WMA)
    • 3: Hull Moving Average (HMA)
  • MA Deviation Threshold in Points (default: 5)
    Minimum price distance from the moving average required to trigger the MA condition.

    • Example: Setting of 5 requires the price to be at least 5 points away from the MA
    • Note: If set to 0, this condition is always considered met regardless of distance from the MA

Average Bar Height Filter

  • Min ABH Value for Signals (default: 0.0)
    Minimum Average Bar Height required for any signal to be valid. Helps filter out low-volatility conditions.

    • Example: Setting of 0.0005 for EUR/USD would require at least 5 pips of average bar height
    • Note: A value of 0 means this filter is ignored completely - all signals will pass regardless of volatility
  • Min Time Between Signals in Ms (default: 5000)
    Prevents repeated signals from firing too frequently, in milliseconds.

    • Example: 5000ms setting ensures at least 5 seconds between consecutive signals
    • Note: A value of 0 means no time-based filtering will occur between signals

Buy/Sell Signal Control

  • Generate Bullish Signals (default: true)
    Enables or disables buy signals.

  • Generate Bearish Signals (default: true)
    Enables or disables sell signals.

Signal Condition Logic

  • Required Conditions (default: 1)
    Bitmap that defines which signal metrics must ALL meet their thresholds for a signal to be valid.

    • 1 = Density
    • 2 = Velocity
    • 4 = Acceleration
    • 8 = Direction
    • 16 = MA
    • Add values to combine them
    • Examples:
      • 1: Only Tick Density required
      • 3: Both Density AND Velocity required (1+2)
      • 31: All five metrics required (1+2+4+8+16)
  • Direction Conditions (default: 26)
    Bitmap that defines which active conditions vote on whether the signal is bullish or bearish.

    • Same bit values apply
    • Examples:
      • 2: Only Velocity determines direction
      • 26: Velocity, Acceleration, and MA determine direction (2+8+16)

These settings give you complete control over how the indicator reacts, what counts as a valid signal, and when those signals are generated. The default settings provide a good starting point, but optimal parameters will vary based on the instrument, timeframe, and specific market conditions you’re trading.

3. Using the Indicator

The Scalper Indicator continuously monitors incoming ticks and evaluates market conditions in real time. Unlike traditional indicators that update once per bar, Scalper recalculates its metrics with every tick, providing immediate feedback on market microstructure shifts as they occur.

This section explains how to interpret the indicator’s outputs, understand signal generation logic, and effectively apply it to your trading approach.

Understanding the Display

When added to a chart, the Scalper Indicator creates a separate window below the main chart containing three lines:

  1. Red Line (Tick Density) - Shows the normalized density of ticks over time
  2. Green Line (Tick Velocity) - Displays the normalized velocity of price movement
  3. Blue Line (Tick Acceleration) - Represents the normalized acceleration of price

These lines give you a visual representation of market activity levels and momentum. Values closer to 1.0 (or -1.0 for negative velocity/acceleration) indicate stronger readings, while values close to zero indicate weak readings.

However, the most valuable real-time information comes from the Live Tick Panel located in the top-left corner of your chart.

Live Tick Panel

If enabled, the Live Tick Panel displays current values for all metrics, updating with every tick. The panel looks similar to this:

Density=0.79 ✔ Velocity=0.34 ✔ Accel=0.015 ✔ Dir=+0.88 ✔ UpTicks=42 DownTicks=17 MA=0.00042 ✔

Each metric shows:

  • Current numerical value
  • Status indicator: ✔ (condition met) or ✖ (condition not met)

For Tick Direction, additional information shows the actual counts of up and down ticks within the time window.

This panel gives you a tick-by-tick summary of market pressure. By watching which conditions are active at any moment, you can gain valuable insights into market microstructure even without waiting for an official signal.

Signal Conditions

Each tick is evaluated against five live metrics:

  1. Tick Density - Is market activity high enough?

    • Measures the number of ticks per millisecond
    • Higher values indicate increased market participation
    • Must exceed the configured threshold to activate
  2. Tick Velocity - Is price moving fast enough?

    • Measures price change per millisecond in points
    • Direction matters (positive = up, negative = down)
    • Absolute value must exceed the threshold to activate
  3. Tick Acceleration - Is momentum increasing?

    • Measures how fast velocity is changing
    • Positive values indicate increasing momentum
    • Negative values indicate decreasing momentum
    • Absolute value must exceed the threshold to activate
  4. Tick Direction - Is there directional consensus?

    • Measures the bias of tick movements (up vs down)
    • Values closer to 1.0 indicate strong directional consensus
    • Must exceed the configured threshold to activate
  5. MA Deviation - Is price stretched from the mean?

    • Measures distance from tick-based moving average
    • Higher values indicate stronger deviation
    • Must exceed the threshold in points to activate

If a metric’s value meets or exceeds its threshold, that condition is considered active (✔). Which of these conditions must be met to trigger a signal is determined by your Required Conditions bitmap setting.

Signal Generation Logic

The indicator generates signals through a two-step process:

Step 1: Condition Validation
The Required Conditions bitmap setting determines which metrics must ALL be active (✔) for a signal to be considered valid. For example, if set to 3 (1+2), both Density AND Velocity must be active.

Step 2: Direction Determination
If all required conditions are met, the Direction Conditions bitmap determines which active metrics “vote” on the signal direction:

  • Each active metric contributes a directional vote based on its value
  • Velocity, Acceleration, and Direction vote based on their sign (+ = bullish, - = bearish)
  • MA votes based on whether price is above (bullish) or below (bearish) the MA
  • The majority vote determines final signal direction

The signal must also pass two additional filters:

  • Minimum ABH - Filters out low-volatility conditions
  • Minimum Time Between Signals - Prevents duplicate signals firing too close together

Only when all criteria are satisfied is a signal generated and pushed to the output buffers.

Practical Application

The Scalper Indicator can be used in several ways:

  1. Visual Analysis

    • Watch the Live Tick Panel for building pressure
    • Use changing patterns in metrics to anticipate potential signals
    • Identify periods of high vs. low density to gauge market activity
  2. Manual Trading Based on Signals

    • Wait for all required conditions to align (✔)
    • Enter trades in the direction indicated by the signal
    • Use visible metric values to evaluate signal strength
  3. Integration with EAsiTrader EA

    • Let the EA automatically read and act on signals
    • Configure Required Conditions and Direction Conditions based on your strategy
    • Use signal filters (ABH, time between signals) to reduce noise
  4. Custom EA Development

    • Access the indicator’s output buffers via iCustom() functions
    • Implement custom logic based on the indicator’s signal data
    • Combine with other indicators for confirmation

Reading Signal Strength

Not all signals are created equal. Assess signal quality by considering:

  1. Metric Values

    • Higher values generally indicate stronger signals
    • Example: Density=0.95 is stronger than Density=0.75
  2. Condition Alignment

    • More conditions aligned (✔) indicate stronger consensus
    • Example: All five metrics active is stronger than just the minimum required
  3. Divergences

    • Conflicting directions between metrics may indicate weaker signals
    • Example: Positive Velocity but negative Acceleration may suggest momentum is waning
  4. Duration of Conditions

    • Conditions that remain active longer often indicate stronger underlying pressure
    • Watch how long metrics stay above thresholds

By understanding both the mechanics and application of the Scalper Indicator, you can leverage its powerful tick-based analysis for precise entry and exit decisions, whether trading manually or through automated systems.

Timeframe Considerations

Important Note on Signal Capacity: The Scalper Indicator can store a maximum of six signals per bar (two signals per buffer across three buffers). When used on higher timeframes, active market conditions might generate more signals than can be stored, resulting in some signals being missed.

  • Recommended Timeframe: 1-minute (M1) or lower timeframes are optimal for most trading scenarios, ensuring all significant signals are captured.

  • Higher Timeframe Usage: When using Scalper on timeframes higher than M1 (such as M5, M15, or H1), be aware that in volatile market conditions, some signals might be lost due to the six-signal limit.

  • Signal Priority: The indicator always stores the most recent signals, discarding older ones if the limit is reached within a single bar.

  • Signal Spacing Strategy: If trading on higher timeframes, consider increasing the “Min Time Between Signals” setting to ensure only the most significant signals are captured, reducing the likelihood of exceeding the signal capacity.

This limitation is a result of the buffer encoding design that ensures precise timestamp storage for tick-accurate backtesting. For most scalping strategies focusing on short-term opportunities, the M1 timeframe provides an optimal balance between signal capture and analytical perspective.

4. Advanced Usage and Strategy Integration

The Scalper Indicator is built from the ground up for integration with automated systems and advanced trading strategies. This section explores how to leverage its internal logic, buffer structure, and signal encoding for sophisticated applications beyond basic signal detection.

Signal Engine Architecture

To fully utilize the indicator, it’s helpful to understand its internal architecture:

  1. Data Flow Pipeline

    • Incoming ticks → Metric Calculations → Normalization → Signal Logic → Buffer Encoding
    • Each stage is customizable through input parameters
  2. Normalization Process

    • Raw metric values are normalized based on recent market conditions
    • The TickNormaliser class uses advanced statistical techniques to adapt to changing market conditions
    • This ensures consistent performance across different volatility environments
  3. Signal Logic Implementation

    • Bitmap-based condition checks determine signal validity
    • Voting mechanism determines signal direction
    • Multiple filters prevent excessive signal generation

This architecture allows for flexible strategy integration and customization based on your specific trading requirements.

Real-Time Filters

Each tick is passed through five independent modules. You decide which of these must be active for a signal to be valid using the Required Conditions setting — a bitmap that supports any combination:

  • 1 = Tick Density
  • 2 = Velocity
  • 4 = Acceleration
  • 8 = Direction
  • 16 = MA Deviation

Add these together to create custom combinations. For example:

  • 3 = Density AND Velocity (1+2)
  • 15 = All except MA (1+2+4+8)
  • 31 = All five metrics required (1+2+4+8+16)
  • 5 = Just Density AND Acceleration (1+4)

Only when all selected conditions are met will a signal become valid.

Signal Voting and Filtering

The Direction Conditions bitmap works the same way, but instead of acting as a filter, it controls which metrics “vote” on signal direction:

  • Velocity votes based on its sign: positive = bullish, negative = bearish
  • Acceleration votes based on its sign: positive = bullish, negative = bearish
  • Direction votes based on tick bias: upward bias = bullish, downward bias = bearish
  • MA votes based on price location: above MA = bullish, below MA = bearish

The majority determines the final signal direction. In case of ties, no signal is generated.

You can further control signal generation with additional filters:

  • Generate Bullish Signals — Enable or disable buy signals entirely
  • Generate Bearish Signals — Enable or disable sell signals entirely
  • Minimum ABH Value — Blocks signals in low-volatility bars
  • Minimum Time Between Signals (ms) — Prevents signal clusters

This gives you complete control over what counts as a signal, how signals are confirmed, and how often they’re allowed to occur.

Technical Indicator Buffers

The Scalper Indicator exposes several data buffers that can be accessed by Expert Advisors:

  1. Tick Density Buffer (0)

    • Contains normalized tick density values (0-1)
    • Higher values indicate increased market activity
  2. Tick Velocity Buffer (1)

    • Contains normalized velocity values (-1 to +1)
    • Positive = upward price movement, Negative = downward price movement
  3. Tick Acceleration Buffer (2)

    • Contains normalized acceleration values (-1 to +1)
    • Positive = increasing momentum, Negative = decreasing momentum
  4. Tick MA Buffer (3)

    • Contains the current tick-based moving average value
    • Used internally for deviation calculations
  5. Signal Flag Buffers (4-6)

    • Special encoded buffers that store signal data
    • Up to 6 signals per bar can be stored with timestamps

To access these buffers from an EA, use code similar to:

// Example: Reading normalized tick density value
double tickDensity = iCustom(_Symbol, _Period, "NTL\\Scalper", 0, 0);

// Example: Reading normalized velocity value
double velocity = iCustom(_Symbol, _Period, "NTL\\Scalper", 1, 0);

// Example: Reading normalized acceleration value
double acceleration = iCustom(_Symbol, _Period, "NTL\\Scalper", 2, 0);`

Encoded Signal Storage

The Scalper Indicator stores up to six directional signals per bar using a sophisticated bitwise encoding system. These signals are recorded across Buffers 4, 5, and 6, with each buffer storing two signals. This approach ensures precise signal timing during backtesting and EA integration.

Signal Bit Structure (26 bits per signal)

Each signal buffer stores two signals using a 52-bit layout within a 64-bit double-precision float. The bit allocation is as follows:

First Signal (bits 0-25):

  • Bit 0
    Signal direction:

    • 0 = Bearish (sell signal)
    • 1 = Bullish (buy signal)
  • Bits 1-25
    Milliseconds since the start of the bar:

    • Range: 0 to 33,554,431 (about 9.3 hours)
    • Provides precise timestamp for tick-accurate backtesting

Second Signal (bits 26-51):

  • Bit 26
    Signal direction for second signal:

    • 0 = Bearish (sell signal)
    • 1 = Bullish (buy signal)
  • Bits 27-51
    Milliseconds since the start of the bar for second signal:

    • Same range as first signal: 0 to 33,554,431
    • Independent timestamp allowing two precise signals per buffer

This detailed timestamp encoding ensures that signals can be accurately reproduced during strategy testing, preserving the exact timing of each signal relative to its bar’s opening time. The remaining bits (52-63) of the 64-bit double are reserved and not used for signal storage.

Buffer Allocation

Three buffers are reserved for encoded signal storage:

Buffer Index Signal Slots
4 Signals 0 and 1
5 Signals 2 and 3
6 Signals 4 and 5

Each buffer stores two 26-bit signals inside a 64-bit double-precision float, with buffer 4 storing the first two signals of the bar, buffer 5 storing the next two, and buffer 6 storing the final two.

Example Code for Signal Decoding

For custom EAs that need to access these encoded signals directly, you can use code similar to:

// Example pseudocode for accessing the first signal on the current bar
double signalData = iCustom(_Symbol, _Period, "NTL\\Scalper", 4, 0);

// Extract direction (bit 0)
bool isBuySignal = ((ulong)signalData & 1) == 1;

// Extract millisecond offset from bar opening time (bits 1-25)
long timeOffsetMs = (ulong)signalData >> 1;

// Calculate absolute time (if needed)
datetime barOpenTime = iTime(_Symbol, _Period, 0);
long absoluteTimeMs = (barOpenTime * 1000) + timeOffsetMs;

5. Signal Retrieval for EAsiTrader Integration

The EAsiTrader EA connects with the Scalper Indicator through the cTickSignalManager class, which provides a specialized signal retrieval system ensuring tick-accurate signal processing. Understanding this mechanism helps when troubleshooting automated trading implementation or developing custom EAs.

How EAsiTrader Reads Scalper Signals

EAsiTrader retrieves signals from the Scalper indicator using the GetSignalFlag function in the cTickSignalManager class, which examines the encoded signal data and extracts valid signals based on timing and direction. Below is the actual MQL5 code that performs this operation:

bool cTickSignalManager::GetSignalFlag(int &flag, int pos, long timeMs, long barOpenTimeMs)
{
   // initialize flag to no trend
   flag = INDICATORSIGNALDATA_NOTREND; 
     
   // new bar?
   if (pos != _pSignalPos)
   {
      if (pos < _pSignalPos)
      {
         _pSignalTimeMs = 0;
      }

      _pSignalIdx = -1;
      _pSignalPos = pos;
   }   

   if (_pSignalIdx < _maxSignalsPerBar - 1)
   {
      // get the signal data for the next signal position from the signal buffer
      ulong data = GetSignal(pos, _pSignalIdx + 1);

      // is there a signal at this position?
      if (data == 0)
      {
         // no, so exit
         return true;
      }

      // calculate absolute time of the signal
      long signalTimeMs = barOpenTimeMs + (long)(data >> 1);

      // is this a future signal not yet processed? (ie. tester)
      if (signalTimeMs > timeMs)
      {
         // yes, so exit
         return true;
      }

      // increment the signal position
      _pSignalIdx++;
   
      // pre-calculate the signal time cut-off window threshold (how old can a signal be before it's ignored)
      // note: timeMs granularity is 1 second, meaning ticks could be + or - 1 second of timeMs
      long lowerTimeBoundMs = timeMs - INDICATORSIGNALDATA_TIMETHRESHOLDCUTOFFINMS;
      long upperTimeBoundMs = timeMs + INDICATORSIGNALDATA_TIMETHRESHOLDCUTOFFINMS;

      // check if signal time is inside time window and it's not the same signal
      if (signalTimeMs >= lowerTimeBoundMs && signalTimeMs <= upperTimeBoundMs && signalTimeMs > _pSignalTimeMs)
      {
         // determine if buy or sell signal (lowest bit)
         flag = (data & 1) == 1 ? INDICATORSIGNALDATA_BULLISH : INDICATORSIGNALDATA_BEARISH;

         _pSignalTimeMs = signalTimeMs;
      }  
   }
   
   return true;
}

ulong cTickSignalManager::GetSignal(int pos, int posSignalIdx)
{
    int bufferIdx = _bufferStartIdx + (posSignalIdx / TICKSIGMALMANAGER_SIGNALS_PER_BUFFER);
    int signalIdx = posSignalIdx % TICKSIGMALMANAGER_SIGNALS_PER_BUFFER;
    ulong data = ((ulong)_bufferManager[bufferIdx].Array[pos] >> (signalIdx * TICKSIGMALMANAGER_BITS_PER_SIGNAL)) & TICKSIGNALMANAGER_SIGNAL_BITMASK;
    return data;
}

This function performs several key operations:

  1. Bar Transition Handling

    • Detects when a new bar is being processed
    • Resets signal tracking state for the new bar
    • Ensures proper signal sequence is maintained across bar boundaries
  2. Signal Data Retrieval

    • Uses GetSignal(pos, _pSignalIdx + 1) to retrieve the next encoded signal data
    • This function accesses the appropriate buffer and extracts the signal using bit operations:
  3. Signal Time Calculation

    • Takes the bar’s open time in milliseconds (provided as parameter)
    • Adds the encoded time offset (extracted from bits 1-25) to calculate absolute signal time
  4. Future Signal Handling

    • Checks if the signal time is in the future relative to current processing time
    • Prevents premature signal processing in testing environments
  5. Time Window Validation

    • Creates a time window around the current EA processing time
    • Lower bound: current time minus threshold
    • Upper bound: current time plus threshold
    • Ensures the signal is newer than previously processed signals
  6. Direction Extraction

    • Extracts the direction bit (bit 0) from the signal data
    • Sets the flag to BULLISH or BEARISH based on the bit value

These two functions can handle up to six signals per bar (two signals per buffer across three buffers) while ensuring they are processed at the correct time and in the correct sequence. This sophisticated time-based signal matching system is what enables EAsiTrader to react to market microstructure changes with minimal latency.

6. Insights

The Scalper Indicator gives you a real-time window into the microstructure of the market—showing not just that price is moving, but how it’s moving. By interpreting its signals correctly, you can anticipate shifts in momentum, identify breakout conditions, and spot exhaustion before it becomes obvious on the chart.

This section breaks down how to get the most value from the signals—whether you’re trading manually or integrating with an EA.

Understanding Signal Quality

The strength of a signal is determined by how many metrics align. A full alignment of all ✔ conditions across:

  • Tick Density
  • Velocity
  • Acceleration
  • Direction
  • MA Deviation

…means you’re seeing a moment of coordinated market pressure—usually before it becomes visible in candles.

  • ✔✔✔✔✔ = High-conviction move, all metrics aligned
  • Mixed ✔ and ✖ = Hesitation or transition, conflicting pressure
  • ✔✔ followed by ✖✖ = Fade or exhaustion, momentum diminishing

Use the Required Conditions setting to define how strict the signal logic is—and tune it to your market conditions.

Market Microstructure Patterns

Beyond basic signals, the Scalper Indicator reveals deeper market microstructure patterns that skilled traders can exploit:

  1. Density Surge Without Price Movement
    When tick density rises sharply but velocity remains low, it often indicates accumulation or distribution before a directional move.

    • Trading Opportunity: Watch for subsequent alignment of direction and velocity for early entry
    • Example: Density rises to 0.9 with Velocity below 0.2, followed by sudden directional alignment
  2. Velocity/Acceleration Divergence
    When velocity is high but acceleration turns negative, it suggests momentum may be waning.

    • Trading Opportunity: Potential reversal or pause in the current move
    • Example: Velocity at 0.8+, Acceleration drops from positive to negative, signaling exhaustion
  3. Direction Flip With High Density
    A sudden shift in tick direction during high-density periods often precedes significant price movement.

    • Trading Opportunity: Enter quickly in the new direction if other metrics confirm
    • Example: Direction shifts from -0.6 to +0.7 while Density remains above 0.8
  4. MA Deviation Extremes
    When price stretches far from the tick MA during high velocity, mean reversion becomes more likely.

    • Trading Opportunity: Counter-trend entry when other metrics show reversal potential
    • Example: MA Deviation exceeds 15 points while velocity begins to decrease

Detecting Momentum and Exhaustion

The combined metrics of the Scalper Indicator are particularly effective at identifying both buildups of momentum and signs of exhaustion:

Momentum Buildup Sequence

  1. Tick Density increases (more market activity)
  2. Direction strengthens (directional consensus forms)
  3. Velocity begins to rise (price movement accelerates)
  4. Acceleration turns positive (momentum increasing)
  5. MA Deviation expands (price moves away from average)

This sequence often precedes strong directional moves and provides early entry opportunities before the move is visible on standard charts.

Exhaustion Sequence

  1. Velocity reaches extreme readings (price moving very fast)
  2. Acceleration turns negative (momentum decreasing)
  3. Direction begins to weaken (consensus breaking down)
  4. Tick Density may remain high (still active but directionless)
  5. MA Deviation at extremes (stretched far from average)

This pattern often precedes reversals or consolidation and can provide precise exit points or counter-trend entries.

Using Scalper for Entry and Exit Timing

The indicator is ideal for improving timing around trade execution:

  • Entry confirmation
    Wait for your strategy conditions, then check if Scalper agrees (✔ on key metrics). Enter only when the signal confirms.

  • Front-running price action
    Many setups become valid before the candle closes. Scalper lets you see them the moment they form.

  • Tighter exits
    Use changes in direction, acceleration, or velocity to exit ahead of reversal—especially on short timeframes.

  • Noise avoidance
    Use ABH filtering and minimum signal spacing to avoid choppy or sideways markets.

Practical Trading Examples

Here are practical ways to apply the Scalper Indicator in different market contexts:

Breakout Trading

  • Setup: Price consolidating near support/resistance
  • Entry Trigger: Density and Direction spike together with aligned Velocity
  • Confirmation: Acceleration turns positive in breakout direction
  • Management: Tight stop below breakout level, target at 1-2× ATR

Trend Continuation

  • Setup: Established trend with pullback to support/resistance
  • Entry Trigger: Direction and Velocity align with trend after pullback
  • Confirmation: MA Deviation shows price returning to trend direction
  • Management: Stop at recent swing, target at next resistance/support

Reversal Trading

  • Setup: Extended move with extreme readings
  • Entry Trigger: Velocity/Acceleration divergence (one turns negative)
  • Confirmation: Direction begins to shift against previous trend
  • Management: Tight stop beyond recent extreme, target at previous support/resistance

Fine-Tuning for Different Instruments

The Scalper Indicator can be optimized for different instruments based on their typical tick behavior:

  • Forex Majors (EUR/USD, GBP/USD, etc.)

    • Generally consistent tick flow
    • Use moderate thresholds (Density: 0.6-0.7, Velocity: 0.5-0.6)
    • Standard time windows (10000ms) work well
  • Index Futures (ES, NQ, etc.)

    • Bursts of high activity followed by quieter periods
    • Consider higher Density thresholds (0.7-0.8)
    • May benefit from shorter time windows (5000-7000ms)
  • Cryptocurrency CFDs

    • Often have irregular tick patterns
    • Consider lower thresholds for Density and Direction
    • May need larger MA Deviation settings due to higher volatility
  • Less Liquid Instruments

    • Sparse tick data requires adaptation
    • Use longer time windows (15000-20000ms)
    • Lower Density thresholds (0.4-0.5) to compensate for fewer ticks

Remember that the indicator’s adaptive normalization will help adjust to each instrument’s characteristics, but these starting points can help optimize performance.

Summary Tips

  • Use strict thresholds for cleaner setups, and loosen them in low-volatility environments.
  • Don’t just act on direction—check whether velocity and acceleration confirm the move.
  • Use the tick panel live or feed the signal buffers into an EA—either way, trust the ✔ alignment.
  • Combine with higher-timeframe filters or structural logic (like trendlines or zones) for best results.

The Scalper Indicator doesn’t predict the future—it tells you what’s happening right now, with tick-level clarity. Use that to act before the candles tell the rest of the world.

7. Creating Custom Scalper Strategies in EAsiTrader

The Scalper Indicator is highly configurable, with 20 core settings and an additional three commonly used in scripts (SL, TP, and BE). This flexibility allows powerful signal generation and precision optimization, but it also introduces a combinatorial challenge.

This section helps you navigate the complexity and use AI to assist with discovering effective strategies.

Step-by-Step: Building a Scalper Strategy

1. Use UserVARs for All Scalper Settings

Assign each of the 20 indicator parameters (EA Flag through Direction Conditions Bitmap) to a unique UserVAR, e.g. VAR0 through VAR19. In this way, each UserVAR number matches the parameter number of the Scalper Indicator, e.g. UserVAR0 = Parameter 0, UserVAR1 = Parameter 1, etc.

Additionally:

  • Use VAR20 for Take Profit multiplier
  • Use VAR21 for Breakeven offset
  • Use VAR22 for Stop Loss size

Example declaration in the .set presets file for the indicator and UserVARs:

;
; Section Custom Indicators
;
InpTradeTool_CustomIndicator17=+NTL\Scalper(VAR0,VAR1,VAR2,VAR3,VAR4,VAR5,VAR6,VAR7,VAR8,VAR9,VAR10,VAR11,VAR12,VAR13,VAR14,VAR15,VAR16,VAR17,VAR18,VAR19).ex5,0,1,2,3,4,5,6,7
;
; Section User Variables
;
InpTradeTool_UserVAR0=1;1                              // EA Flag
InpTradeTool_UserVAR1=10000;3000,5000,7000,10000,15000 // Tick Density Window in ms
InpTradeTool_UserVAR2=0.7;0.3,0.5,0.6,0.7,0.8,0.9      // Tick Density Signal Threshold
InpTradeTool_UserVAR3=10000;3000,5000,7000,10000,15000 // Tick Velocity Window in ms
InpTradeTool_UserVAR4=0.3;0.1,0.2,0.3,0.4,0.5          // Tick Velocity Smoothing
InpTradeTool_UserVAR5=0.6;0.3,0.4,0.5,0.6,0.7          // Tick Velocity Signal Threshold
InpTradeTool_UserVAR6=10000;3000,5000,7000,10000,15000 // Tick Acceleration Window in ms
InpTradeTool_UserVAR7=0.5;0.1,0.3,0.5,0.7              // Tick Acceleration Smoothing
InpTradeTool_UserVAR8=0.3;0.1,0.2,0.3,0.4,0.5          // Tick Acceleration Signal Threshold
InpTradeTool_UserVAR9=10000;3000,5000,7000,10000,15000 // Tick Direction Window in ms
InpTradeTool_UserVAR10=0.7;0.4,0.5,0.6,0.7,0.8         // Tick Direction Signal Threshold
InpTradeTool_UserVAR11=10;5,8,10,12,15                 // Tick MA Period
InpTradeTool_UserVAR12=1;0,1,2,3                       // Tick MA Method
InpTradeTool_UserVAR13=5;2,4,6,8,10                    // MA Deviation Threshold in Points
InpTradeTool_UserVAR14=0.0005;0.0,0.0003,0.0005,0.0007,0.0010 // Min ABH Value for Signals
InpTradeTool_UserVAR15=5000;0,1000,3000,5000,7000      // Min Time Between Signals in ms
InpTradeTool_UserVAR16=1;1                             // Generate Bullish Signals
InpTradeTool_UserVAR17=1;1                             // Generate Bearish Signals
InpTradeTool_UserVAR18=31;1,3,7,15,31                  // Required Conditions Bitmap
InpTradeTool_UserVAR19=26;2,6,10,26,30                 // Direction Conditions Bitmap
InpTradeTool_UserVAR20=2.0;1.0,1.5,2.0,2.5,3.0         // TP multiplier (× SL)
InpTradeTool_UserVAR21=0;0,2,5,10,15                   // BE offset in points
InpTradeTool_UserVAR22=10;10                           // SL size in points

2. Define Entry, SL, TP, and BE Scripts

Example scripts:

InpTradeTool_ScriptLongEntry=Signal('Scalper1') == Bullish ? Ask() : 0
InpTradeTool_ScriptLongInitialStop=Low(1) - VAR22 * Point
InpTradeTool_ScriptLongTrailingStop=
InpTradeTool_ScriptLongLots=
InpTradeTool_ScriptLongTakeProfit=OrderPrice() + VAR22 * VAR20 * Point
InpTradeTool_ScriptLongBreakeven=OrderPrice() + VAR21 * Point
InpTradeTool_ScriptLongExit=
InpTradeTool_ScriptShortEntry=Signal('Scalper1') == Bearish ? Bid() : 0
InpTradeTool_ScriptShortInitialStop=High(1) + VAR22 * Point
InpTradeTool_ScriptShortTrailingStop=
InpTradeTool_ScriptShortLots=
InpTradeTool_ScriptShortTakeProfit=OrderPrice() - VAR22 * VAR20 * Point
InpTradeTool_ScriptShortBreakeven=OrderPrice() - VAR21 * Point
InpTradeTool_ScriptShortExit=

3. Control Combinatorial Explosion with Segmented Optimization

Optimizing all variables together is infeasible (e.g. 14+ trillion combinations). Instead:

  • Segment optimization into phases where each run only tests ≤ 200 passes.
  • Fix non-targeted UserVARs to a single default value for each run.
  • Use .set files to define and run each phase.

Example phase:

Phase 1 → Optimize VAR1, VAR2 (Tick Density group)
Phase 2 → Optimize VAR3, VAR4, VAR5 (Velocity group)
...

🚀 Using AI to Help You Discover Settings

You can use AI to brainstorm high-quality parameter ranges based on your strategy goals. When working with AI, always provide it with the necessary context. Reference the following documentation in your prompt for best results:

These guides define how the system works, what each UserVAR controls, and how signal generation is processed.

✅ Example AI Prompt for Generating UserVAR Ranges

I am building a strategy using a tick-based indicator called NTL Scalper in MetaTrader. Each setting is mapped to a UserVAR from VAR0–VAR19. I want to optimize it using EAsiTrader. Please suggest optimized default values and value sets for the following:

- Tick Density Window (VAR1): e.g. 3000–15000 ms
- Tick Velocity Smoothing (VAR4): e.g. 0.1–0.5
- Tick Acceleration Signal Threshold (VAR8)
- Tick Direction Signal Threshold (VAR10)
- MA Deviation Threshold (VAR13)
- Min ABH for Signals (VAR14)
- Min Time Between Signals (VAR15)
- Required and Direction Conditions (VAR18, VAR19): bitmap logic (e.g. 3, 15, 31)

Explain how each setting impacts signal quality and how tighter or looser values might suit different instruments like EURUSD or Gold.

Also recommend which parameters I should optimize first, and which can usually be left at defaults.

✅ Example AI Prompt for Full Strategy Planning

Act as an expert in high-frequency trading and automated strategy development. I am using a tick-level signal engine with 20 parameters, and I can only optimize 200 combinations at a time. Please help me:

1. Segment the parameter list into logical groups to optimize sequentially.
2. Recommend good starting values for EURUSD scalping on M1.
3. Suggest how to interpret the output metrics (Profit, Drawdown, WinRate).
4. Guide me on how to balance signal strength vs frequency using the bitmap settings.
5. Propose example values for SL (VAR22), TP multiplier (VAR20), and BE offset (VAR21).

✅ Best Practices

  • Keep required logic minimal in scripts — use only VAR references and core functions like Ask(), Bid(), SLSize(), OrderPrice().
  • Use Point in scripts to correctly scale all price-based calculations.
  • Always include a Min Time Between Signals filter to reduce false positives.
  • Use VAR18 and VAR19 to control how many metrics are required and which metrics vote.

Summary

  • Use UserVARs to control all key parameters.
  • Define modular scripts using those VARs.
  • Optimize in phases, ≤ 200 passes each.
  • Use AI prompts to help generate ranges, default values, and optimization plans.
  • Save .set files for each phase and merge the best performers for full-strategy deployment.

8. Glossary

Tick-Based Terminology

  • Tick
    The smallest price change in a financial instrument, representing individual transactions or quote updates from the market.

  • Tick Density
    A measure of market activity calculated as the number of ticks per millisecond within a defined time window. Higher density indicates more active trading.

  • Tick Velocity
    The speed of price movement in points per millisecond, indicating how fast prices are changing. Positive values indicate upward movement, negative values indicate downward movement.

  • Tick Acceleration
    The rate of change of velocity, showing how rapidly price momentum is increasing or decreasing. Positive values indicate increasing momentum, negative values indicate decreasing momentum.

  • Tick Direction
    A measurement of the directional bias in recent ticks, calculated by comparing the number of up ticks versus down ticks. Values range from -1.0 (all down) to +1.0 (all up).

  • Tick Moving Average (Tick MA)
    A moving average calculated based on a specified number of ticks rather than a fixed time period, providing a more responsive measure of average price.

Signal Components

  • Required Conditions
    A bitmap setting that defines which metrics must all be active for a signal to be considered valid. Each bit represents a different metric condition.

  • Direction Conditions
    A bitmap setting that determines which active metrics contribute to determining the direction (bullish or bearish) of a valid signal.

  • Signal Flags
    Encoded values stored in indicator buffers that contain signal direction and precise timing information for trading systems to access.

  • ABH (Average Bar Height)
    The average height of price bars over a period, used as a filter to ensure market volatility is sufficient for signal generation.

Buffer Terminology

  • Buffer
    An array that stores indicator values or encoded data for each bar in the chart.

  • Signal Buffer
    Special buffers (4-6) that store encoded signal information including direction and timestamp data.

  • Buffer Manager
    A component that handles buffer allocation, resizing, and access for efficient data management.

Encoding Concepts

  • Bitmap
    A binary representation where each bit position has a specific meaning, used for Required Conditions and Direction Conditions settings.

  • Bitwise Operations
    Low-level programming operations that manipulate individual bits within data, used for efficient signal encoding and decoding.

  • Signal Encoding
    The process of compressing signal information (direction and timestamp) into a compact binary representation for efficient storage.

Trading Terminology

  • Scalping
    A trading strategy focused on profiting from small price changes, typically holding positions for short time periods ranging from seconds to minutes.

  • Market Microstructure
    The detailed study of how markets function at the transaction level, including order flow, bid-ask spreads, and tick-by-tick price formation.

  • Signal Generation
    The process of creating algorithmic trade signals based on predefined conditions and market patterns.

  • Momentum
    The rate of acceleration in price movement, indicating the strength of a trend. In the Scalper indicator, this is measured through Velocity and Acceleration metrics.

  • Mean Reversion
    A theory suggesting that prices tend to return to their average over time. The Tick MA component helps identify potential mean reversion opportunities.

Technical Terms

  • Normalization
    The process of scaling values to a standard range (like 0-1 or -1 to +1) to make them comparable across different market conditions.

  • Adaptive Thresholds
    Values that automatically adjust based on current market conditions rather than remaining fixed, improving indicator performance across varying volatility.

  • Exponential Smoothing
    A mathematical technique that applies more weight to recent data points while still considering older values, reducing noise in calculations.

  • Time Window
    A defined period (in milliseconds) over which market data is analyzed for metric calculations.

Rev:20.5.2025 10:01