Mathematic parameters in forex robot EA MPGOv3.2.5


What Forex Video-Course about?


Hi dear friends ! In this Forex Video-Course i will try describe all text parameters of expert advisor “MT4 forex robot EA “Multi-Pair-Grid-Overlap_v3.2.5” and additionally will record video examples how to use every parameter and every indicator strategies we coded into expert advisor

TMA EA Hedging expert advisor forex video-course
All parameters of Robot posted also at Forum. Register at Forum and post your ideas for future versions of EA


ALL TRADING PAIRS IN 1 SET


PairsForTrading=EURGBP;EURAUD;EURNZD;EURUSD;EURCAD …. etc up to 28 FX pairs ( XAUUSD, us500, nasdaq, dax and any other indices/commodities/shares can be used in this parameter (!) but only with indicators that builtin EA for 1 pair (please do not use IndexAll indicator at dax).

Robot can work from 1 chart at all pairs ! [1-28] but its not necessary to use all 28.  You may enter from 1 up to 28 pairs and each pair will share the same EA settings. Please input all required pairs and separate them using symbol [ ; ] as above, and at the end of last pair do not input anything. Add also Suffix for your pairs if broker have them: EURUSDx;GBPUSDx; or EURUSD.m;GBPUSD.m;…Before use some pairs – open all pairs in Market Watch of MT4 and check – does your pairs tradable or not (try to put little pending order at less. Sometimes Broker have EURUSD and EURUSDm at one account). If you wish to trade any pairs with separate EA settings than open a separate chart and enter alternative settings as required.

In strategy Tester of MT4 please use Only 1 Pair in this parameter and use 1 pair Indicator types of entry! MT4 tester cannot open orders in Tester more then at 1 pair !!! MT4 tester cannot analyse Muti-pair indicators!!! Don’t try to run multi-pair IndexAll entry or multi-pair robots in tester of MT4 –  you will have ZeroDivide Error! (Multi-pair Tester Metaquotes coded only in MT5). In version v3.1.4.0 to use signal Index_all need to entry all 28 pairs in PairsForTrading parameter (indicator use all 28 pairs to build 8 indexes and signals) there you can copy 28 pairs if need :

EURGBP;EURAUD;EURNZD;EURUSD;EURCAD;EURCHF;EURJPY;GBPAUD;GBPNZD;GBPUSD;GBPCAD;GBPCHF;GBPJPY;AUDNZD;AUDUSD;AUDCAD;AUDCHF;AUDJPY;NZDUSD;NZDCAD;NZDCHF;NZDJPY;USDCAD;USDCHF;USDJPY;CADCHF;CHFJPY;CADJPY

Please attach EA at the fastest TF you use in SET (see indicators entries Block). MT4 cannot read M15 from H1 (if you attached EA at H1)

1
Forex Video-Course Math Parameters EA MPGOv3.2.5 24

LoadHistoricalData = True // If True – it will update once per 1 bar (where you installed/attached EA) your all MarketWatch pairs tick data and all TimeFrames  automatically for correct indicators work and calculations. Also EA will do same first time when you attach it on chart (patience – it can take up to 5 minutes and will not open any trades until will not finish it process )

2
Forex Video-Course Math Parameters EA MPGOv3.2.5 25

TimeStartEnd = False // Use Trading Time Filter – Yes/No
HourStart
 = 0; // Time for EA start work if all orders are Closed before that time
HourEnd = 20 // Time to Finish trading Today and Close any possible little profit and all orders at account at that time if CurrentEquity>StartDepo (or Depo0 in GlobalVariables) balance when EA started New Last Serial. If you entry HourStart=8 and HourEnd=20 (by your broker server time) it means EA will trade between this time and try to reach MaxEquityProfit MANY TIMES ! If after HourEnd=20 robot see that at account Equity StartDepo(Depo0) – robot will Close all orders at account to fix even Little Profit Today and Depo0 EA will rewrite to Current balance! If You don’t like to use new Daily Time of trading! Make like this: HourStart=0 and HourEnd=25 (its impossible parameters). This parameter sometimes not work good in different GMT time zones (make errors sometimes – better test it first at Demo)
TimeStartEnd = False // Use Trading Time Filter – Yes/No
HourStart = 0; // Time for EA start work if all orders are Closed before that time
HourEnd = 20 // Time to Finish trading Today and Close any possible little profit and all orders at account at that time if CurrentEquity>StartDepo (or Depo0 in GlobalVariables) balance when EA started New Last Serial. If you entry HourStart=8 and HourEnd=20 (by your broker server time) it means EA will trade between this time and try to reach MaxEquityProfit MANY TIMES ! If after HourEnd=20 robot see that at account Equity StartDepo(Depo0) – robot will Close all orders at account to fix even Little Profit Today and Depo0 EA will rewrite to Current balance! If You don’t like to use new Daily Time of trading! Make like this: HourStart=0 and HourEnd=25 (its impossible parameters). This parameter sometimes not work good in different GMT time zones (make errors sometimes – better test it first at Demo)

3
Forex Video-Course Math Parameters EA MPGOv3.2.5 26

VisualButton = True // show control panel buttons Yes/No. This software is designed not only for Automated trading type but also to perform in semi-automated mode for bigger profit (user control and help EA from time to time, i.e. close current profits reached, add trend orders in hedge of global direction, additional pending orders for News trading across the price, change temporary Equity Targets to start OverLap function … etc) . TurnOff this parameter in Tester and Optimisation – Ea will work faster, also TurnOff if you work in Total Automated mode

4
Forex Video-Course Math Parameters EA MPGOv3.2.5 27

Debug = True // Parameter for Testers users that in ‘journal’ check different debug stuff that we coded for them (for example if Debug=True you can how EA print TMA indicators values for TypeTMA8 and 9…etc). Sometimes if our testers and clients dedicate errors in EA about indicators entries they ask me to add Bebug function in separate function to see does EA read correct indicators and make correct entries from current signals or not. If not – we start search errors in Code to Fix Bigs

5
Forex Video-Course Math Parameters EA MPGOv3.2.5 28

NoNewTrade = False // if True – after EA reach Target Equity and close all orders at Account (including your manual and other EAs orders) EA will not open any new order and serials in any direction. But if EA not reaching target yet and EA have existed serials with NoNewTrade=true – it can open new grid orders in existed serials to try reach target equity and will not open any new Serials (Start orders of new Serial). This parameter for thous who need only 1 target+ EA Stop and do not start new Serials until user will make manually in Set NoNewTrade=False. To make EA working one more cycle and reach new TargetEquity just make NoNewTrade = False (EA Start to trade) and after EA just opened orders – you can make again NoNewTrade = True if you like EA to Stop after its reached Target Equity (at same time you can control EquityTarget % from EA buttons if you like). If activate this parameter in True – so EA not entry at NEW PAIRS even if signal coming, its only continue work at existed pairs that have already orders to finish current serial till TargetEquity, or EA will use LastTp (or TrailingStop) at every order if all orders goes profit…

6
Forex Video-Course Math Parameters EA MPGOv3.2.5 29

Control_LimitStop = True; // Allow management of the advisor, using manual pending orders without any comments or magic numbers as Signals for Grid serial at separate pairs.

Signals:

  1. if True – EA will not open sell or buy until Human will not place Sell Limit (for Sell direction) or Buy Limit (for Buy direction) at pair he would like to trade such directions.
  2. Start and continue Trading Sell of EA MPGO at pair: just put at this pair Sell Limit order above current price any lot size with MagicNumber=0 (or empty Magic Number). This pair must be also in parameter PairsForTrading
  3. Stop Trading Sell direction of EA MPGO at pair: delete all Sell Limit orders with MagicNumber=0 (or empty Magic Number) at such pair
  4. Close all opened Sell positions at pair: put at pair Sell Stop below the current price any lot size with MagicNumber=0 (or empty Magic Number) at such pair
7
Forex Video-Course Math Parameters EA MPGOv3.2.5 30

TradeBuy = True // if False – EA will not open any Buy order at any pair

PairsOnlyTradeBuy
 = EURUSD ; GBPUSD; NZDUSD // enter there pairs that you would like to trade only Buy (enter also this pairs in 1st parameter called PairsForTrading. All Signals Must be OFF to use this option of separate SELL and BUY direction in 1 Set at all pairs)

TradeSell = True // if False – EA will not open any sell order at any pair

PairsOnlyTradeSell
 = EURJPY ; GBPJPY; CADJPY //enter there pairs that you would like to trade only Sell (enter also this pairs in 1st parameter called PairsForTrading. All Signals Must be OFF to use this option of separate SELL and BUY direction in 1 Set at all pairs)

NewSerialBuy = True // if False – EA will not open new buy Grid serial trades. It will finish any/all existing buy serial trades

NewSerialSell = True // if False – EA will not open new sell Grid serial trades. It will finish any/all existing sell serial trades

NewLevelBuy = True // if False – no new grid level in buy series (level = Next Grid order in Grid serial, example of 4 levels of 1 grid series : 0.01 0.02 0.03 0.04)

NewLevelSell = true // if False – no new grid level in sell series

8
Forex Video-Course Math Parameters EA MPGOv3.2.5 31

RISK & LOT SIZE


StartLot = 0.0 // Use in Default 0 . EA dedicate Minimal Start lot of any broker automatically

9
Forex Video-Course Math Parameters EA MPGOv3.2.5 32

ReverseStartLot = False // multiplier for only first (start) level of the grid based at Hedge % from opposite serial. It can effect also next grid levels after reversed order in his serial, all lot multiplier will use this order lots to calculate next levels in same direction. Example: EA have 0.1+ 0.1+ 0.1+ 0.2+ 0.3+ 0.4 (sum total 1.2 lot) already opened in Sell direction and will try to open reverse start order in buy using the settings of CoefReverseStartLot below; (he have no buy orders yet) with CoefReveseStartLot = 0.3 (means 30% from 1.2 of sell sum lots) 0.3*1.2= 0.3 lots will be start lot of buy serial. After this EA will continue buy serial like this 0.3 0.3 0.3 0.5 0.7…means it will effect at next orders – they will be bigger than opposite sell serial levels

CoefReverseStratLot = 0.3 // portion of reverse start lot (in 1st grid level only). If sum sell lots at 1 pair = 1.5 lots EA will try to open in start lot of buy serial 30% from 1.5 sell lots : 1.5*0.3=0.5 lots is a start order of buy grid serial

FirstLotFactor = 1.0 // [1.0-3.0] multiplier only for 1st level of grid that not effect next levels. If FirstLotFactor=2 then EA will use multiplier only for 1st level of grid 0.2 0.1 0.1…and will not effect next grid levels. if FirstLotFactor=2.5 then EA will open 0.25 0.1 0.1…(that change only 1st start order of serial and all next calculation in serial think that nothing happened)

StopFirstLot = 10; // after what level of grid we stop use function called FirstLotFactor

10
Forex Video-Course Math Parameters EA MPGOv3.2.5 33

Risk = 0.001  // Use 1 time parameter to trade same Risk at all pairs in one Set. To use separate Risks at different pairs in one set entry separate Risks using comma 0.01;0.02;0.01;0.05 …. The number and order of risks should correspond to the number of pairs that you entered in the PairsForTrading parameter. This EA coded for default balance = 10 000 (Cents or Standard account). Examples of using different risk and start orders of grid serial:
Standard or ECN Account (min lot of Broker = 0.01) | Balance = 10 000 | Risk = 0.001 | Grid Start Order = 0.01 lot
Standard or ECN Account (min lot of Broker = 0.01) | Balance = 10 000 | Risk = 0.02   | Grid Start Order = 0.02 lot
Standard or ECN Account (min lot of Broker = 0.01) | Balance = 10 000 | Risk = 0.22   | Grid Start Order = 0.22 lot
Standard or ECN Account (min lot of Broker = 0.01) | Balance = 20 000 | Risk = 0.03   | Grid Start Order = 0.06 lot (because 20000/10000=2 and 2*0.03=0.06)

Roboforex Cent Account (min lot of Broker = 0.1) | Balance = 10 000 | Risk = 0.001 | Grid Start Order = 0.1 lot (because EA dedicate MinLot of Broker automatically – learn parameter StartLot = 0.0)
Roboforex Cent Account (min lot of Broker = 0.1) | Balance = 10 000 | Risk = 0.01 | Grid Start Order = 0.1 lot (again because of parameter StartLot = 0.0)
Roboforex Cent Account (min lot of Broker = 0.1) | Balance = 10 000 | Risk = 0.10 | Grid Start Order = 0.1 lot
Roboforex Cent Account (min lot of Broker = 0.1) | Balance = 30 000 | Risk = 0.11 | Grid Start Order = 0.33 lot

UseCostOfPip = True // important parameter only for Multi-pair Set. EA use every pair cost of 1 pip and pickup such started lots of serial that give in money same values per 1 pip at any pair

11
Forex Video-Course Math Parameters EA MPGOv3.2.5 34

MaxLotRisk = 20.0 // this is max lot that EA can use in Grid serial at one level. Calculation based at 10 000 balance and EA will grow MaxLotRisk if your balance also grow. If your balance grows to 20 000 from 10 000 the EA will understand that 20 max lot was for 10 000 and will automatically adjust this setting for 20 000, it will hold MaxLotRisk=40 (as double from MaxLotRisk=20 because start deposit doubled also from 10 000 to 20 000). No need to change it manually from 20 to 40. More balance – mоre MaxLotRisk EA can use based at proportion of 10 000 balance. this is why its called MaxLotRisk – based at risk calculation with current balance in proportion from 10 000 Balance:
Examples when during trading MaxLotRisk same but MaxLot that EA can use grow with current balance:
If MaxLotRisk=10
Balance=10 000 | MaxLot that EA can use=10 >>> Balance=20 000 | MaxLot that EA can use=20 >>> Balance=25 000 | MaxLot that EA can use=25

12
Forex Video-Course Math Parameters EA MPGOv3.2.5 35

MaxTrades = 15 // [1-30] how many levels of grid the EA can open in 1 direction at 1 pair. If = 15 it means the EA can open up to 15 sell and 15 buy grid levels per pair (total 30 per 1 pair, no more)

13
Forex Video-Course Math Parameters EA MPGOv3.2.5 36

MaxSpreadPips = 4.5 // Filter : EA will not trade this pair if it has Current Spread over this value in pip

14
Forex Video-Course Math Parameters EA MPGOv3.2.5 37

GRID


TypeOfOrders = 0 // [0 1 2] 0 – all market orders, 1 – only start orders of serials will be pending orders that follow the price and all other next levels of the grid will be usual market orders, 2 – all levels of the grid will be a pending orders

15
Forex Video-Course Math Parameters EA MPGOv3.2.5 38

TrendStep = 100000 // EA will use only start lot order of serial and continue this in trend every TrendStep pips 0.1 0.1 0.1 0.1 …it some kind of pyramid hedging in trend but with constant same order based at start order of serial. If price retrace after trend – possible this orders will have some minus and need to manage them manually if you used this function. (Also if profit – this orders can be used in VirtualTrailingStop below parameter to trail them)

16
Forex Video-Course Math Parameters EA MPGOv3.2.5 39

PIPsStep = 10 // minimal step between 2 market type grid levels (orders) 0.1-PipsStep-0.1-PipsStep-0.1-PipsStep-0.2 . Ea will use this distance between levels only if you use non-indicator modes and only Market Types of orders (pending orders type can filter bigger distance because of trail pending orders in trends). Otherwise there will be bigger step>10 because of indicator and pending orders filtering and New function AutoPipStep. In version v3.1.3.3 – once AutoPIPSTEP=True // True = Turn on AutoPipStep , False = TurnOff AutoPipStep. EA can calculate separate AutoPipStep for different pairs based at their HighLow bars at any TF per any candles. If use D1 – it will be ADR – Average Daily Range / divided by some value

17
Forex Video-Course Math Parameters EA MPGOv3.2.5 40

AutoPipstepADR=False // ON/OFF function of Autopipstep (this function can take any TF and collect average candle High-Low and reduce it at your divider to calculate and modify current variable pipstep at separate pair)

AutoPipstepADRTF=2 // what TF use to calculate Average High-Low ? 0-Current, 1-M1, 5-M5, 15-M15, 30-M30, 60-H1, 240-H4, 1440-D1. Added also M2 M3 or any other Renko Offline charts can be used that generated already with some other software.

AutoPipstepBars=2 // how many bars back EA take to calculate AutoPipStep at AutoPipstepADRTF(including Current Bar that not closed yet)

AutoPipstepADRdivider=4 // EA will look at 19 bars back + 1 bar (current bar) and will calculate “Averages of their High-Low-s”, and will divide it to 6 (AutoPipstepADRdivider). The found value will be AutoPipStep for Current pair (for all pairs will be different personal AutoPipStep in this case)

18
Forex Video-Course Math Parameters EA MPGOv3.2.5 41

PENDING ORDERS FILTER


PendingFollowDistance = 22 // [10-50] If you use TypeOfOrders = 1 or 2, the EA will start to use pending Stop orders to filter price. If price go up – the EA will follow current price (like a trailing stop) with sell stop order at a distance of 22 pips under the price. A good filter to not open many orders opposite the trend direction or price spikes and can be used also as additional temporary filter at news trading (this parameter will be used only in TypeOfOrders = 1 & 2)

PendingFollowStep = 2 // [1-5] if price runaway from pending stop order ea will replace every 2 pips PendingFollowDistance to follow the price if its become > then 22 pips (PendingFollowDistance = 22). Similar to trailing stop working – we can call it trail of Pending Stop orders (this parameter will be used only in TypeOfOrders = 1 & 2)

DeletePendIfSignal=False; // EA can place pending order with some indicator signal but if this parameter will be in TRUE and signal change to opposite – EA will delete such wrong pending order by signal changes or repaints.

19
Forex Video-Course Math Parameters EA MPGOv3.2.5 42

LOT EXPONENTS (GRID MULTIPLIER)


TypeFirtsLotExponent = 1; // 0 — Next Order of Grid = Previous * FirstLotExponent .  1 — Next Order of Grid = Previous + Start Lot of Serial (0.1 | 0.1+0.1=0.2 | 0.2+0.1=0.3 | 0.3+0.1=0.4 | …. )

FirstLotExponent = 1.0 // [1.0-3.0] multiplier for next levels of the grid for TypeFirstLotExponent=0. If FirstLotExponent=1.5 and TypeFirstLotExponent=0 ea will open serial like this: 0.1 | 0.1*1.5=0.15 | 0.15*1.5=0.22 | 0.22*1.5=0.33 | …If NumberOfLevel2ndLE = 5 and if FirstLotExponent= 1 ea will open 5 first orders of grid like this : 0.1 0.1 0.1 0.1 0.1 . If FirstLotExponent=2 ea will open 5 next orders with lot sizes : 0.1 0.2 0.4 0.8 1.6 . If = 1.4 ea will open next : 0.1 0.14 0.19 0.27 0.38 . (every next order = previous * FirstLotExponent till SecondLotExponent that can have different value and calculation method)

20
Forex Video-Course Math Parameters EA MPGOv3.2.5 43

NumberOfLevel2ndLE = 6 // at what level of the grid EA stop using FirstLotExponent and start use SeconLotExponent

TypeSecondLotExponent = 0 , 1 or 2 // 0 – NextGridLot = Previous * SecondLotExponent, 1 – NextGridLot = Previous + (SummaryGridSerialLot * SecondLotExponent),  2 – NextGridLot = Previous + MinimalBrokerLot

SecondLotExponent = 1.5 // lot multiplier factor that will be used in 3 formulas in parameter TypeSecondLotExponent

21
Forex Video-Course Math Parameters EA MPGOv3.2.5 44

VIRTUAL STOP LOSS (VSL) OF GRID ORDERS


VirtualStopLossPips = 22 // if order go in such negative pips of profit – EA start use VSL at this order.

VSLLevel = 3 // before this level of grid VirtualStopLossPips not working and will start working for grid orders that will be opened after and at this level

StepVirtualStopLossPips = 22 // Once we reached VirtualStopLossPips EA will close every StepVirtualLossPips a part from order.

CoefVirtualStopLossPipsKys=0.1; // Part from order that robot will close every StepVirtualStopLossPips (0.1 = 10%)
MaxOperationsVSL = 8; // How many times he close 10% of order and at last part #8 we will close all


LOCK


OpenLock = false // if true EA will lock current grid serial with hedge order and drop this serial. EA will not open any new grid order after locking of this serial

LockPercentFromSummary = 0.8 // portion of Hedging . For example you have sell serial 0.1 0.2 0.4 0.8 1.6 = 3.1 summ lot. 0.8 means 80% from 3.1 must be opened in buy to hedge this serial in 80% : 3.1*0.8 = 2.48 lot EA will open in Buy and drop this serial until user will not back to comp and will not decide what to do with that and how to help it. Some kind of protection. recommended only for traders who can open lock in positive. Otherwise better do not use this function at all because it temporary hedge or lock only minus equity, not plus and need knowledge and experience to open negative lock. Good thing that it will not let blow your acc if you use nonindicator mode without limitation in MaxTrades

LockDraw = 15 // what drawdown EA must dedicate at 1 pair to start hedge it with Lock order ?

22
Forex Video-Course Math Parameters EA MPGOv3.2.5 45

VIRTUAL TAKE PROFIT “LASTTP” + OVERLAP


LastTP = true // if true – EA use Virtual Take Profit for last biggest order in grid serial to close it in profit. Broker do not see (VTP) take profits of this EA

TypeOverLap = 4 // [0 1 2 3 4] 0 – EA does not use new profit to cancel out old orders to minimise DrawDown (eat pieces of old orders with Cross-Closing by using New Profit = OverLap); 1- EA will cancel out older orders to minimise DrawDown starting with the oldest or the very first order; 2- EA will start cancelling out the most recent trade; 3- EA will start cancelling out starting from the second last order. TypeOverlap fixed in New version v3.1.4.0.5 – if EA cannot use TypeOverlap=3 (when serial do not have 3 orders) it will try use TypeOverlap=2 for 2 orders ! if not possible use TypeOverlap=2 ea will use TypeOverlap=1. 4- EA will use New profit to eat pieces of order near BreakEven Line in Serial of Grid at most “drawdown” pair and serial that it trade

CoefLast = 1.0 // portion, how much EA can use from lastTP profit in OverLap function. 1=100% , 0.3 = 30% to eat pieces of old orders by profit/loss in proportion

LastTPPips = 10 // Virtual Take Profit (VTP) of last order of grid. Broker do not see this TP – ea hold this in memory and check every tick. How much pips last order must go in profit to close it by LastTP function of robot. Ea can reopen several times this order and close them to VTP – in flat EA doing lots of profit and rebates. LastTPPips after version 3.1.3.1 always = AutoPipstep at your separate pair! Also in Function of AutoPipstep added protection from low pipstep in Flat

LevelStartLastTP = 1 // [1..10] at what level of grid ea start use LastTP (or VTP) function . (cannot equal = 0 or ea will show Error. First minimal level of Grid =1

LastTPFixedPips = False // if True – EA will always use constant LastTPPips for Take Profit that disconnected from Autopipstep. If False – EA use LastTPPips = current AutoPipstep, but LastTPPips cannot be < PipStep (protection from low AutoPipstep and low LastTPPips) ExMinLotKys= 0.01; // minimal part of lot to eat in overlap function (default of most brokers is 0.01 but you can make it 0.1 then EA will do less operation in overlap)


VIRTUAL TRAILING STOP


TrailGo = true // use virtual trailing stop (VTS) ? it make sense use in True only if you use LevelStartLastTP > 1 [2-3] and you need to trail sometimes start orders

Tak = 30 // Profit in pips to start using VTS in Grid Ordes

StepTak = 2 // step to move VTS for profit order to follow current price with distance TrailDistance

TrailDistance = 10 // minimal Trail Stop from current price where ea follow SL in profit for order. ( Learn your broker StopLevels for SL! )

fGloseOrdPr=False // Close trailing stop once signal changed to opposite


If you have any question or suggestions for improving this forex video-course please contact us Support@fxpip.one

Expert Advisor EA MPGO prices : https://www.fxpip.one/mql-soft/
Contact us in Telegram: @AlexFXPIP

Leave a Reply