A Minimal Alternating Buy-Sell Expert Advisor with Fixed Stops and Targets
Summary
This short MetaTrader expert advisor opens an initial sell position when initialized, with stop loss and take profit set to fixed point distances. On later starts, it checks open orders for the current symbol and, when no matching order is found, submits a trade in the direction opposite the most recently observed order type. The lot size is carried forward from the selected order, so the basic design alternates between sell and buy positions using the same size.
The accompanying description calls the EA operational and mentions that martingale behavior could be added, but gives no optimization settings, test results, market, timeframe, or evidence of profitability. The code’s order scanning and stored state are minimal, and its behavior depends on the platform’s order lifecycle and execution. Fixed stops and targets do not by themselves control cumulative exposure or guarantee that the strategy’s alternating entries will perform well; the document provides no broader risk framework.
Key ideas
- The EA starts by opening a sell with fixed stop-loss and take-profit distances.
- When it finds no open order for the symbol, it submits the opposite trade direction.
- The lot size is reused from the previously selected order.
- The document mentions possible martingale additions but provides no optimization evidence or performance results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.