Join our fan page
Avalanche AV - expert for MetaTrader 5
- Published by:
- Vladimir Karputov
- Views:
- 4634
- Rating:
- Published:
- 2018.09.27 15:39
- Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Idea by: Murad Ismayilov
MQL5 code author: barabashkakvn
This Expert Advisor is one of the variations of the Avalanche EA.
How it works
The trade direction is selected randomly based on the random number generator MathRand: if the number is less than 16384, Buy is opened, otherwise Sell is opened. Trading begins with the volume of Start Lots. The Stop Loss and Take Profit parameters can be disabled by setting them to "0.0".
Position volume calculation
General principle: if the last position was closed with a loss, the next volume will be increased Volume expansion factor times. Volume is calculated in OnTradeTransaction: Types of trade transactions and Deal properties (market exit) are tracked.
Notes: the Expert Advisor tracks the maximum account balance value (the value is saved in the m_prev_balance_max variable), and controls the 'not enough money' error when opening a position. The position volume is increased until the last position is closed with a profit, at the same time the current trading account balance must exceed m_prev_balance_max. If the "not enough money" error is encountered (CheckVolume volume of the CTrade class), the calculated volume is reset to Start Lots.
Example of test charts in the "Every tick based on real ticks" mode:
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/21727
Klinger Oscillator developed by Stephen Klinger to determine the long-term trend while remaining sensitive to detect short-term fluctuations enabling the trader to predict short-term reversals.
Dynamic_TrendThe Dynamic Trend signal indicator draws a two-color trend direction line and adds signal arrows.
The Mirror MA indicator features two mirrored moving averages in a separate chart window calculated based on a difference between two MAs with different calculation data, and one signal line calculated based on a direct moving average data.
Above Below MAAn Expert Advisor based on the iMA (Moving Average, MA) indicator.