The analytical part of the Expert Advisor is based on the Valentina indicator algorithm with all settings corresponding to the indicator ones.
The execution part is of combined nature. The EA can be used as a standard conservative trading robot (working only with a single order) and an averaging order grid using martingale.
Grid orders are opened in three modes:
- A fixed step, in pips
- A fixed step considering analytical algorithm signals
- Only when the next signal arrives
Orders are closed:
- Only after reaching Take Profit
- After reaching Take Profit or by an opposite order if an opposite signal appears
- Only by an opposite order (Take Profit is 0 and Close Orders opposite Condition is true)
All open positions can be accompanied by a trailing stop. Trailing stop starts working from an order Open level (profit only).
Trailing stop and stop loss track each order separately.
- Fixed Lot ("false" - percentage of deposit) - fixed lot flag. If false, a lot size depends on a deposit volume.
- Lot Size - lot size. The parameter works if Fixed Lot = false.
- Percentage of Deposit (for calculation of the lot size) - deposit percentage used to calculate a lot size. The parameter works if Fixed Lot = false.
- Take Profit - take profit, in pips.
- Stop Loss - stop loss, in pips.
- Trailing Stop - trailing stop.
- Close Orders opposite Condition - close position by an opposite order if an opposite market entry signal appears.
- Stop Equity - close all positions when reaching a value specified in Risk Equity. The parameter works if set to true.
- Risk Equity - deposit adequacy percentage. If the percentage is reached, all open positions are closed.
- Position opening next Bar ("false" - instantly) - open position when a market entry signal appears. true - open position at the first tick following a signal one. false - open position when a signal appears.
- Number of Trades Nets ("0" - Net OFF/Order open only one) - amount of averaging orders. If 0, the network is disabled. The EA works with a signal order only.
- Step Nets for next Order ("0" - Only on the condition) - step (in pips) between averaging orders. If 0, grid orders are opened only in case a signal arrives from the indicator algorithm when Consider the Conditions of the Algorithm = true.
- Consider the Conditions of the Algorithm - consider the indicator algorithm signals for opening grid orders. If false, averaging grid orders are opened only with a step specified in Step Nets for next Order. If true, averaging orders are opened with a step set in Step Nets for next Order only when a market entry signal arrives from the indicator algorithm.
- Multiplier next Lot - multiplier for calculating a lot size for the subsequent grid orders (for example, if 2.0 , the size of each subsequent order is doubled: 1, 2, 4, 8, 16, 32, etc. If 0.5, the size of each subsequent order is reduced by half: 1, 0.5, 0.25, 0.12, 0.06. If 1.0, all subsequent orders have the same size specified in Lot Size or calculated in Percentage of Deposit).
- Period - period used for the indicator calculation.
- Amount of Bars (for calculating) - amount of bars used in calculation.
- Trip Level - signal trigger level filter.
The EA's initial parameters are set for EURUSD M15.