Skip to content
All library documents

Independent Long and Short Systems with Loss-Based Position Sizing

Article MQL5 code base

Summary

This Expert Advisor design runs separate long and short systems based on ColorSchaffJCCXTrendCycle signals. Each side has its own settings and magic number, allowing the trader to configure or test them independently. The document emphasizes that the two directions may need different parameters because markets can behave asymmetrically.

Position size is adjusted using recent results for each side: if enough of the most recent trades were losses, the next position uses a reduced volume; otherwise it uses the normal volume. The example settings use five recent trades and a threshold of three losses, with smaller and standard volumes specified separately. The document mentions tests on GBPUSD at the H8 timeframe over 2017 and says stop loss and take profit were not used. It provides no detailed performance statistics or robustness analysis, so the examples do not establish profitability. The indicator dependencies must also be available for the EA to operate.

Key ideas

  • Long and short trades can be managed as independent systems with separate settings and identifiers.
  • The EA can use different parameters for rising and falling market conditions.
  • Recent losses in one direction can trigger reduced position size for the next trade in that direction.
  • The described historical test omitted stop loss and take profit, limiting what can be inferred about risk.

Tags

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