An Expert Advisor based on the "Two sides of he martingale" strategy.
EA open two opposite deals - BUY and SELL
New system with automatic smart Martingale CrazySaw
Martingale and Trade on Pending Orders (Pendulum Principle) Swing
Martingale is a betting management system. This type of strategy is very popular in roulette. This principle is also widely used in Forex.
After starting the EA we open two opposite deals - BUY and SELL. The initial stop loss should be equal to the take profit. For example: StopLoss = 100, TakeProfit = 100.
In this case, when stop loss triggers on one order, we get the activation of take profit on the second one. Thus the result is 0. Then the next series of deals is opened, but on the following condition. The volume of the next deal of the same type is equal to Lot * martingale. And then we cover the loss of the first deal and earn a profit of 100 points. On the example of the Expert Advisor:
- Magic - magic number.
- StopLoss - the stop loss value, 0 - not used.
- TakeProfit - the take profit value, 0 - not used
- Slippage - slippage
- MarketWatch - trading mode. If MarketWatch = true, first positions/orders without stops are placed, and then they are modified (for some brokers).
- Lots - fixed lot.
- Martin - the martingale coefficient for the deal following the losing one. If 1, then it is not used.
- MaxSpreadToNotTrade - maximum spread filter for opening trades.
- MinSpreadToNotTrade - minimum spread filter for opening trades.
- MaxOrders = maximum number of legs (trades) in one series in one series.
- AdjustTP - adjustment of the take profit in points.
- AdjustAfter - the number of the leg, after which the take profit will be increased\decreased by AdjustTP points.
- StopDayTradingEaAfterTP - stop the EA operation after reaching take profit in the current day. The EA starts trading the next day only.
- TrailingStopUSE - use trailing stop.
- IfProfTrail - use the breakeven mode only for profitable positions.
- TrailingStop - trailing distance, 0 - the minimum allowed.
- TrailingStep - trailing step.
- Added the SecondsToRefresh parameter to the EAPADPRO block - refresh rate of the information on the chart (default is 10 seconds). This is done to reduce the CPU load.
- Added parameter
MaxSpreadToNotTrade and MinSpreadToNotTrade
MaxSpreadToNotTrade - Maximum spread, at which the EA can open a trade
MinSpreadToNotTrade - Minimum spread, at which the EA can open a trade
- Added the EAPADPRO information panel
Details on the panel in our blog: http://www.expforex.com/publ/eapadpro_novyj_sovremennyj_informacionnyj_blok_dlja_nashikh_ehkspertov/6-1-0-153
The strategy block includes the following variables:
Current loss in the grid for the BUY SELL directions
current number of the BUY SELL leg
Current lot of BUY SELL - if there are insufficient funds for the next lot, the EA will output NoMoney
- Added the AdjustTP and AdjustAfter parameters
AdjustTP - adjust the take profit when opening pending orders.
AdjustAfter - number of the left after which the adjustment will be applied.
Once the EA places AdjustAfter amount of orders, the take profit of the next trade will be increased by AdjustTP * (NumberOfLegs - AdjustAfter) points.
When positions are closed by stop loss, the loss includes not only the stop loss level, but also the spread, especially if it is floating.
In order to achieve the take profit that can cover all previous stop losses, it is necessary to increase the take profit of each new pending order.
This feature allows doing that.
- Added parameter
MaxOrders - the maximum number of positions in 1 direction
If MaxOrders=5, and 5th position (for example) in the current grid in one direction closed in a loss, then the next leg will be opened with the initial lot, and the grid will start working from the new position.
StopDayTradingEaAfterTP - if the last position closed by take profit (separate for BUY SELL directions), the EA stops its operation until the next day (separate for BUY SELL directions)