Wajdyss Ichimoku Candle MMRec Strategy
Overview
This strategy is a direct port of the MetaTrader expert Exp_wajdyss_Ichimoku_Candle_MMRec. It recreates the "wajdyss Ichimoku candle" indicator by computing the Ichimoku base line (Kijun) and classifying each finished candle into one of four color states. The system then looks for a reversal in those colors to fade the most recent move. When the previous bar was above the Kijun and the latest signal bar falls below it, the algorithm closes any short exposure and opens a long trade. The opposite transition flips into a short position. An adaptive money management module replicates the original MMRec logic by shrinking the position size after a configurable number of losing trades in the same direction.
The converted version uses the StockSharp high-level API. Candles are supplied through a single SubscribeCandles call, and the Kijun level is
calculated with Highest/Lowest indicators. Trading decisions are only evaluated on finished candles to keep the behaviour deterministic
across real-time and historical modes.
Candle coloring logic
Each closed candle is assigned a numeric color index that matches the original MQL5 indicator:
| Color | Condition | Meaning |
|---|---|---|
0 |
Close below Kijun and a bearish body | Strong bearish sentiment below the base line |
1 |
Close below Kijun but a bullish body | Weak bullish reaction underneath the base line |
2 |
Close above Kijun but a bearish body | Weak bearish reaction above the base line |
3 |
Close above Kijun and a bullish body | Strong bullish continuation above the base line |
Signal logic
Signals are generated on finished candles by comparing the color of two historical bars:
- Long setup: the bar at
SignalBarShift + 1had a color greater than1(price above Kijun) and the bar atSignalBarShifthas a color below2(price moved below Kijun). The strategy optionally closes any open short position and can open a new long. - Short setup: the bar at
SignalBarShift + 1had a color below2(price below Kijun) while the bar atSignalBarShiftprints a color above1(price moved above Kijun). The strategy optionally closes existing longs and can enter a short position.
The SignalBarShift parameter corresponds to the SignalBar input of the MetaTrader version. The default value 1 means that the signal uses
the last fully closed candle and the one before it. Increasing the shift delays entries by the requested number of bars.
Money management
The MMRec module keeps a short history of trade outcomes per direction. If the last LossTriggerCount trades in one direction were all losers,
the strategy switches to the reduced order size (ReducedVolume). After a profitable trade, or when fewer than the requested number of trades
are available, the default volume (NormalVolume) is restored. This mirrors the behaviour of BuyTradeMMRecounter and SellTradeMMRecounter
from the original MQL library.
Risk management
Protective stop-loss and take-profit levels are expressed in price steps. When a long position is open, the strategy checks whether the candle
low reached entry - StopLossPoints * PriceStep or whether the high touched entry + TakeProfitPoints * PriceStep. The short side mirrors the
logic. The stops are evaluated once per finished candle, similar to the source EA which relied on server-side orders with a fixed distance.
Parameters
| Parameter | Description | Default |
|---|---|---|
CandleType |
Candle data type (time-frame) used for the indicator | 1 hour candles |
KijunLength |
Lookback of the Ichimoku base line | 26 |
SignalBarShift |
Number of closed bars to skip before evaluating the color transition | 1 |
BuyPosOpen / SellPosOpen |
Enable or disable opening positions in each direction | true |
BuyPosClose / SellPosClose |
Allow closing existing positions on the opposite signal | true |
NormalVolume |
Default order volume | 1 |
ReducedVolume |
Order volume after the configured number of losses | 0.1 |
LossTriggerCount |
Number of losing trades in a row before reducing size | 2 |
StopLossPoints |
Stop distance in price steps (set to 0 to disable) |
1000 |
TakeProfitPoints |
Take-profit distance in price steps (set to 0 to disable) |
2000 |
Usage notes
- The strategy opens trades only when the color transition indicates exhaustion and the relevant direction is enabled.
- Volume scaling requires that the platform reports trade results; in backtests the exits generated by the strategy will update the loss history automatically.
- If no price step is defined for the security, the stop-loss and take-profit inputs are ignored.
- Setting
SignalBarShiftto0mimics an immediate reaction to the latest finished candle but increases the risk of whipsaws.