Skip to content
All library documents

Independent Long and Short PEMA Systems with Loss-Based Sizing

Article MQL5 code base

Summary

The document describes an Expert Advisor that runs separate long and short trading systems using ColorPEMA_Digit signals. Each direction has independent entry and exit blocks and its own position-sizing settings, so outcomes on one side do not determine sizing on the other. The system adjusts the next trade’s volume according to recent results: if a configured number of the last trades in that direction are losses, it uses a smaller volume; otherwise it uses the normal volume. The example settings illustrate this rule for both buys and sells.

The document reports a historical test on EURAUD at the 12-hour timeframe over 2017 using the default inputs, with no stop loss or take profit. It provides no performance figures or detailed evaluation of the chart, so the test alone does not establish robustness or live-trading suitability. The EA also depends on a separately compiled indicator file, and its sizing behavior should be understood as a risk-control mechanism rather than evidence that losses will be recovered.

Key ideas

  • Long and short signals are handled by independent systems with separate settings.
  • Each direction can reduce its next trade volume after a configured number of recent losses.
  • Normal and reduced trade volumes are set separately for buys and sells.
  • The cited EURAUD test used default inputs and omitted stop loss and take profit.

Tags

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