IndexRaider Library MT4
- Libraries
- Version: 1.0
- Activations: 20
IndexRaider Library exposes the IndexRaider engine as callable functions:
the liquidity-sweep (SFP) detection, the H4 trend bias, the fair value gap
confirmation and the risk-based position sizer used across the IndexRaider
product family. Build your own Expert Advisor, indicator or panel on the
same rules - the library does the analysis, your program makes the
decisions.
WHAT IT EXPORTS
- IXR_Drive(symbol) - advances the per-symbol state machine on H1 data;
call it on tick or timer, it acts once per completed H1 bar and returns
the phase: 0 idle, 1 sweep seen / awaiting confirmation, 2 setup armed
- IXR_Setup(symbol, direction, entry, sl, tp) - the armed setup's levels
while the phase is 2 (entry at the gap edge, stop beyond the sweep wick,
target at the far end of the raided range)
- IXR_Bias(symbol) - the H4 EMA 20/50 trend bias: +1, -1 or 0
- IXR_CalcVolume(symbol, direction, entry, sl, risk_pct) - position size
for your risk percentage, snapped to the broker's lot step, checked
against the minimum stop distance and free margin; returns 0 when the
trade should be refused rather than oversized
- IXR_Phase, IXR_Reset, IXR_SetMinRR, IXR_Version - state and settings
HOW TO USE
#import "IndexRaiderLibrary.ex4"
int IXR_Drive(string symbol);
bool IXR_Setup(string symbol, int &direction, double &entry,
double &sl, double &tp);
double IXR_CalcVolume(string symbol, int direction, double entry,
double sl, double risk_pct);
#import
void OnTick()
{
if(IXR_Drive(_Symbol) == 2)
{
int dir; double entry, sl, tp;
if(IXR_Setup(_Symbol, dir, entry, sl, tp))
{
double vol = IXR_CalcVolume(_Symbol, dir, entry, sl, 0.25);
// place your order here - the library never trades by itself
}
}
}
THE RULES INSIDE
An established swing level (3-bar fractal, 9-96 bars old) is wicked
through but the candle closes back across it, with the H4 EMA 20/50 trend
agreeing; a displacement candle of at least 1x ATR14 leaves a fair value
gap within 12 bars; setups below the minimum reward-to-risk (default 1.5,
adjustable) are discarded and an armed setup expires after 16 bars. Every
decision is made on completed candles only - the same strictly causal
logic as the IndexRaider Expert Advisor and Indicator.
The library performs analysis and sizing only. It never opens, modifies
or closes a position - order execution stays entirely in your code.
WORKS ON
MetaTrader 4, build 600 or later.
Prefer ready-made? The IndexRaider Expert Advisor trades these setups
automatically, the IndexRaider Indicator draws them on the chart, and
IndexRaider Manager adds one-click risk-based execution for manual
trading (separate products).
Trading involves substantial risk of loss. Past performance does not
guarantee future results.
