Trading Router

MT4/5 TradingRouter EA Settings

Trading Router Client Token


These are Trading Router client tokens for receiving Tradingview signals on MT4/5

Trading Router Client Tokenis an identifer of your account.

You can find your client token on the dashboard of trading router website. You must input client token to connect to server. Client token is a string starting with "client".



Syntax Settings

Syntax works together with parameters in message


This section is settings for using different syntax options in Tradingview alert messages

Stop Loss Synatx


This parameter manages stop loss on MetaTrader 4 and MetaTrader 5

Stop loss syntax determine the stop loss. It has 3 inputs: "SL Source", "Stop Loss (sl=)", and "SL Type (sl=)"


"SL Source" input has two options: "Set stop loss by message" and "Set stop loss by EA, from the input below"
This is an example to show how to specify stop loss source from either Tradingview alert messages or from MT4/5 EA settings

If you choose "Set stop loss by message", the stop loss will be determined by the Stop Loss Parameter in message. Please refer to Stop Loss Parameter on Syntax page

If you choose "Set stop loss by EA, from the input below", the stop loss is determined by "Stop Loss (sl=)" input, and the stop loss type is determined by "SL type (sl=)" inputs. You don't need Stop Loss Parameter in message, any Stop Loss Parameter in message will be ignored.

Set stop loss by EA exmaple 1
This is an example to show how to specify stop loss values as points

The stop loss is 10 points away from open price.

  • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_lots=0.1 (note: stop loss is 10 points above open price)
  • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_lots=0.1, sl_pips=20 (note: stop loss is still 10 points above open price, the sl_pips= in message is ignored)


Set stop loss by EA exmaple 2
This is an example to show how to specify stop loss values as percentage

The stop loss is 2 percentage away from open price.

  • token=master19dd529542d4b79d2bc4, signal=buy, symbol=AUDUSD, risk_lots=0.1 (note: stop loss is 2% below open price)
  • token=master19dd529542d4b79d2bc4, signal=buy, symbol=AUDUSD, risk_lots=0.1, sl_pips=50 (note: stop loss is still 2% below open price, the sl_pips= in message is ingored)


Set stop loss by EA exmaple 3
This is an example to show how to specify stop loss values as exact price

The stop loss is the exact price $970.

  • token=master19dd529542d4b79d2bc4, signal=buy, symbol=BTCUSD, risk_lots=0.1 (note: stop loss is $970)

This setting is not recommended, because the stop loss for all you order is placed at $970, it may not be a valid stop loss for all symbols. For example, if you buy BTCUSD, $970 may be a valid stop loss, but if you sell BTCUSD, $970 may be a invalid stop loss. And also if you buy EURUSD, $970 may not be a valid stop loss.



Take Profit Synatx


This parameter manages take profit on MetaTrader 4 and MetaTrader 5

Take profit syntax determine the take profit. It has 3 inputs: "TP Source", "Take Profit (tp=)", and "TP Type (tp=)"


"TP Source" input has two options: "Set take profit by message" and "Set take profit by EA, from the input below"
This is an example to show how to specify take profit source from either Tradingview alert messages or from MT4/5 EA settings

If you choose "Set take profit by message", the take profit will be determined by the Take Profit Parameter in message. Please refer to Take Profit Parameter on Syntax page

If you choose "Set take profit by EA, from the input below", the take profit is determined by "Take Profit (tp=)" input, and the take profit type is determined by "TP Type (tp=)" inputs. You don't need Take Profit Parameter in message, any Take Profit Parameter in message will be ignored.

Set take profit by EA exmaple 1
This example shows how to specify take profit as points

The take profit is 10 points away from open price.

  • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_lots=0.1 (note: take profit is 10 points below open price)
  • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_lots=0.1, tp_pips=20 (note: take profit is still 10 points below open price, the tp_pips= in message is ignored)


Set take profit by EA exmaple 2
This example shows how to specify take profit as percentage

The take profit is 2 percentage away from open price.

  • token=master19dd529542d4b79d2bc4, signal=buy, symbol=AUDUSD, risk_lots=0.1 (note: take profit is 2% above open price)
  • token=master19dd529542d4b79d2bc4, signal=buy, symbol=AUDUSD, risk_lots=0.1, tp_pips=50 (note: take profit is still 2% above open price, the tp_pips= in message is ingored)


Set take profit by EA exmaple 3
This example shows how to specify take profit as exact price

The take profit is the exact price $1000.

  • token=master19dd529542d4b79d2bc4, signal=buy, symbol=BTCUSD, risk_lots=0.1 (note: take profit is $1000)

This setting is not recommended, because the take profit for all you order is placed at $1000, it may not be a valid take profit for all symbols. For example, if you buy BTCUSD, $1000 may be a valid take profit , but if you sell BTCUSD, $1000 may be a invalid take profit . And also if you buy EURUSD, $1000 may not be a valid take profit.



Risk Synatx


This section is settings for managing risk on MT4/5

Risk syntax determine the volume. It has 3 inputs: "Risk Source", "Risk (risk=)", and "Risk Type (risk=)"


"Risk Source" input has two options: "Set risk by message" and "Set risk by EA, from the input below"
This picture shows how to choose source for risk management, it could be either from Tradingview alert messages or from MT4/5 EA settings

If you choose "Set risk by message", the volume will be determined by the Risk Parameter in message. Please refer to Risk Parameter on Syntax page

If you choose "Set risk by EA, from the input below", the volume is determined by "Risk (risk=)" input, and the risk type is determined by "Risk Type (risk=)" inputs. You don't need Risk Parameter in message, any Risk Parameter in message will be ignored.

Set risk by EA exmaple 1
This picture shows how to manage risk in terms of lots

The volume is 0.1 lots.

  • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD (note: create 0.1 lot of sell position for EURUSD)
  • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_cncy_amt=200 (note: still create 0.1 lot of sell position for EURUSD, the risk_cncy_amt in message is ignored )


  • Set risk by EA exmaple 2
    This picture shows how to manage risk in terms of currency amount

    200 amount of currency that you will lose if your trade hits the SL. If you account's currency is USD, then you will lose $200 when the trade hits SL.

    You must set stop loss either by Stop Loss Parameter in message, or by Set Stop Loss in EA, because the volume of the order is calculated according to stop loss.

    • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, sl_pips=100 (note: stop loss is 100 points from open price. The volume is calculated by stop loss so that when the trade hits the stop loss, the trade will lose 200 amount of currency. If your base currency is USD, then $200 will be lost when the trade hits stop loss.)
    • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, sl_pips=100, risk_cncy_amt=150, (note: stop loss is 100 points from open price. The volume is calculated by stop loss so that when the trade hits the stop loss, the trade will still lose 200 amount of currency. If your base currency is USD, then $200 will be lost when the trade hits stop loss. the risk_cncy_amt= parameter in message is ignored. )


    Set risk by EA exmaple 3
    This picture shows how to manage risk in terms of balance loss percentage

    0.5% amount of currency that you will lose if your trade hits the SL.

    You must set stop loss either by Stop Loss Parameter in message, or by Set Stop Loss in EA, because the volume of the order is calculated according to stop loss.

    • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, sl_pips=100 (note: stop loss is 100 points from open price. The volume is calculated by stop loss so that when the trade hits the stop loss, the trade will lose 0.5% of your balance.)
    • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_pct_bal_loss=0.8, , sl_pips=100 (note: stop loss is 100 points from open price. The volume is calculated by stop loss so that when the trade hits the stop loss, the trade will still lose 0.5% of your balance. The risk_pct_bal_loss= parameter in message is ignored )


    Set risk by EA exmaple 4
    This picture shows how to manage risk in terms of balance margin loss

    The trade will increase 0.5% of the margin.

    • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD (note: If your balance is $10000, the 0.5% of your balance is $50. The volume is calculated so that the trade will increase your margin by $50. )




    Pending Order Entry Price Type (price=)

    Define the type of price= parameter in message. If your message does not have price=, or the price= is ingored in your message, this setting will have no effect

    Refer to price= on Syntax page


    Pending Order Entry Price Type (price=) example
    This picture shows how to specify entry price as points for pending orders on MT4/5
    • token=master19dd529542d4b79d2bc4, signal=buylimit, symbol=EURUSD, price=300, risk_lots=0.1 (note: create a buylimit order for 0.1 lot of EURUSD, the entry price is 300 below current market price )
    • token=master19dd529542d4b79d2bc4, signal=buystop, symbol=EURUSD, price_pips=500, risk_lots=0.2 (note: create a buystop order for 0.2 lot of EURUSD, the entry price is 500 above current market price, there is no price= so the "Pending Order Entry Price Type (price=)" setting does not have effect)
    • token=master19dd529542d4b79d2bc4, signal=buystop, symbol=EURUSD, price=300, price_pips=500, risk_lots=0.2 (note: create a buystop order for 0.2 lot of EURUSD, the entry price is 500 above current market price, the price= is ignored before price_pips= has higher priority and price_pips=500 is used)


    Account Filter Type (accfilter=)

    Define the type of accfilter= parameter in message. If your message does not have accfilter=, or the accfilter= is ingored in your message, this setting will have no effect

    Refer to accfilter= on Syntax page


    Account Filter Type (accfilter=) example
    This picture shows how to filter Tradingview alerts according to MT4/5 account balance
    • token=master19dd529542d4b79d2bc4, signal=buy, symbol=EURUSD, risk_lots=0.1 , accfilter=5234.5 (note: create a long position for 0.1 lot of EURUSD if your current account balance is greater then 5234.5 )
    • token=master19dd529542d4b79d2bc4, signal=buy, symbol=EURUSD, risk_lots=0.1 , accfilter_bal = 6000, accfilter=5234.5 (note: create a long position for 0.1 lot of EURUSD if your current account balance is greater then 6000. the accfilter=5234.5 is not used because accfilter_bal= has higher priority. )


    General Settings


    This section is the general settings of Trading Router MT4/5 EA

    Pyramiding

    Determine how multiple trades are handled.

    this setting only works for market order.

    It has four options: "All incoming trades will open without restrictions", "If symbol & direction in profit", "Either 1 Buy Or 1 Sell", "Only 1 Buy And 1 Sell"

    This picture shows how to specify pyramiding trading on MT4/5

    If you choose "All incoming trades will open without restrictions", there is no restriction, all incomding market buy/sell trades will be handled

    If you choose "If symbol & direction in profit", an incoming market buy/sell trade will be handled only if the all the orders with the same symbol and direction have a positive net profit. For example, an incoming buy EURUSD order will only be created if the sum of all long EURUSD positions has a profit of more than 0.

    If you choose "Either 1 Buy Or 1 Sell", there will be at most one open trade for a symbol at any time. For example, if there is already one open EURUSD long position, then any buy or sell EURUSD market order will not be handled. If there is alrady one open EURUSD short position, then any buy or sell EURUSD market order will not be handled.

    If you choose "Only 1 Buy And 1 Sell", there will be at most one long position and one short position for a symbol at any time For example, if there is already one open EURUSD long position but no open EURUSD short position, then any incoming buy EURUSD market order will not be handled, but the next incoming sell EURUSD market order can be handled.



    Close on Reverse

    Determines the treatment of opposite signals.

    This setting only works for buy/sell market order

    It has three options: "On -- Hedging", "On -- Netting", "Off -- No Close on reverse"

    This picture shows how to set close on reverse option for trades on MT4/5

    If you choose "On -- Hedging", an incoming order will close all the opposite positions for the same symbol before make the incomding order. For example, if you send a buy 0.1 lot EURUSD message, all short EURUSD positions will be closed, then 0.1 lot of long EURUSD position will be created.

    If you choose "On -- Netting", an incomding order will close the same volume of opposite positions for the same symbol. If the incoming order's volume is more than all opposite positions, then the incoming order will create a position with remaining volume, otherwise no new position will be made. For example, if there are already 3 short EURUSD positions and the total volume is 0.9 lots. When a buy 1.2 lots EURUSD order comes, all the short 0.9 lots EURUSD will be close, and 0.3 lots long EURUSD will be created, because 1.2 - 0.9 = 0.3. Another example, if there are already 3 short EURUSD positions and the total volume is 0.9 lots. When a buy 0.8 lots EURUSD order comes, then 0.8 lots short EURUSD will be closed and 0.1 lot short EURUSD position will remain, and no new long position is created.

    If you choose "Off -- No Close on reverse", then an incoming order will not affect any existing positoins



    Shadow Targets

    Apply additional take profit and stop loss

    This setting works for both market order and pending order

    This setting only affect the initial stop loss and take profit of orders or positions, it does not affect SL Trailing Feature and Breakeven Feature

    It has two options: "On ", "Off"

    This picture shows how to set shadow targets options for trades on MT4/5

    If you choose "On", additional 100 points stop loss and take profit will be applied to the order.

    Shadow Target On Exmaple
    This picture shows how to turn on shadow targets option for trades on MT4/5
    • token=master19dd529542d4b79d2bc4, signal=buy, symbol=EURUSD, risk_lots=0.1 , sl_pips=20, tp_pips=30 (note: create a long position for 0.1 lot of EURUSD, the stop loss in message is 20 points, and additional 100 points stop loss is added, so the stop loss of the position is 120. The take profit in message is 30 points, and additional 100 points take profit is added, so the take profit is 130.)

    If you choose "Off", no additional stop loss and take profit will be applied


    This picture shows how to turn off shadow targets option for trades on MT4/5


    Slippage

    The default slippage for market orders.

    This settings only works on buy/sell market order

    If there is no slippage= parameter in message, the default slippage in this setting will be used.

    If there is slippage= parameter in message, this setting will be ignored


    This picture shows how to set slippage on MT4/5
    • token=master19dd529542d4b79d2bc4, signal=buy, symbol=EURUSD, risk_lots=0.1 (note: create a long position for 0.1 lot of EURUSD, the slippage is 1000)
    • token=master19dd529542d4b79d2bc4, signal=buy, symbol=EURUSD, risk_lots=0.1, slippage=150 (note: create a long position for 0.1 lot of EURUSD, the slippage is 150. Because there is slippage= parameter in message, the slippage setting in EA will be ignored.)


    Risk Management Settings


    This is another risk management section on Trading Router MT4/5 EA

    Partial Close Percentage

    This setting is used by closelongpct and closeshortpct command

    You can set Partial Close Percentage to any value less than 100, then whenever closelongpct or closeshortpct comes, that percentage of initial volume will be closed


    Partial Close Percentage example
    set Partial Close Percentage to 30, whenever closelongpct comes, 30% of initial volume will be closed.
    This picture shows how to close 30% of trades when MT4/5 receiving Tradingview signals
    • token=master19dd529542d4b79d2bc4,signal=buy, symbol=EURUSD, risk_lots=1 (note: 1 lot of EURUSD long position is created. Initial volume is 1 lot.)
    • token=master19dd529542d4b79d2bc4,signal=closelongpct, symbol=EURUSD (note: 0.3 lot of EURUSD long position is closed )
    • token=master19dd529542d4b79d2bc4,signal=closelongpct, symbol=EURUSD (note: 0.3 lot of EURUSD long position is closed )
    • token=master19dd529542d4b79d2bc4,signal=closelongpct, symbol=EURUSD (note: 0.3 lot of EURUSD long position is closed )
    • token=master19dd529542d4b79d2bc4,signal=closelongpct, symbol=EURUSD (note: final 0.1 lot of EURUSD long position is closed )


    Max Open Positions

    The max positions TradingRouter EA can make

    This setting only works for buy/sell market order

    If Max Open Positions is 0, then there is no limit for how many positions can be created.

    If Magic Restriction is On, this setting only considers the positions opened by this EA

    If Mgaic Restriction is Off, this setting considers all positions including positions created by other EAs or created manually


    Max Open Positions example 1

    If you set Max Open Positions to 10 and Mgaic Restriction is Off

    There are already 9 open positions made by this EA, and 2 positions made manually.

    An incoming buy market order will not be processed because there are already 11 open positions


    Max Open Positions example 2

    If you set Max Open Positions to 10 and Mgaic Restriction is On

    There are already 9 open positions made by this EA, and 2 positions made manually.

    An incoming buy market order can be processed because there are only 9 open positions created by this EA.



    Max Open Positions Per Symbol

    The max positions for any symbol TradingRouter EA can make

    This setting only works for buy/sell market order

    If Max Open Positions Per Symbol is 0, then there is no limit for how many positions for any symbol can be created.

    If Magic Restriction is On, this setting only considers the positions opened by this EA

    If Mgaic Restriction is Off, this setting considers all positions including positions created by other EAs or created manually


    Max Open Positions Per Symbol example 1

    If you set Max Open Positions Per Symbol to 10 and Mgaic Restriction is Off

    There are already 9 open EURUSD positions made by this EA, and 2 open EURUSD positions made manually.

    An incoming buy EURUSD market order will not be processed because there are already 11 open EURUSD positions


    Max Open Positions Per Symbol example 2

    If you set Max Open Positions Per Symbol to 10 and Mgaic Restriction is On

    There are already 9 open EURUSD positions made by this EA, and 2 open EURUSD positions made manually.

    An incoming buy EURUSD market order can be processed because there are only 9 open EURUSD positions created by this EA.



    Daily Profit Management


    This section is settings on MT4/5 EA for managing daily profit

    Daily Profit Management set a goal for daily profit. When the goal is achieved, actions will be taken. The actions include close all positions, halt the EA for some time. When the EA is at halt, you can use eaon command to reactivate the EA.

    Daily Profit Management has 9 inputs: "Daily Profit", "Daily Profit Type", "Daily Profit Action", "Daily Profit Halt Time Type", "Daily Profit Halt EA Hours", "Daily Profit Halt EA Minutes", "Daily Profit Halt EA Until (Broker Time)", "Daily Profit/Loss Check Time (Broker Time)", and "Check Equity at Start and Wakeup for Daily Profit/Loss"

    Daily Profit

    If "Daily Profit" is 0, then there is no goal for daily profit.

    Daily Profit Type

    If "Daily Profit Type" is Percentage, the value of Daily Profit means percentage and profit is defined by percentage of the initial equity of every day.

    If "Daily Profit Type" is Currency, the value of Daily Profit means amount of currency and profit is defined by currency of the initial equity of every day.

    Daily Profit Action

    There are three options for action when daily profit goal is reached, "Halt EA", "Close All Positions", and "Close All Positions and Halt EA". If you choose "Halt EA" or "Close All Positions and Halt EA", the "Daily Profit Halt Time Type", "Daily Profit Halt EA Hours", "Daily Profit Halt EA Minutes" and "Daily Profit Halt EA Until (Broker Time)" defines how long the EA will be halted. When the EA is at halt, you can use eaon command to reactivate the EA.

    Daily Profit Halt Time Type

    Daily Profit Halt EA Hours

    Daily Profit Halt EA Minutes

    Daily Profit Halt EA Until (Broker Time)New since version 2.12)

    If "Daily Profit Halt Time Type" is Halt Duration, then Haily Profit Halt EA Hours and Daily Profit Halt EA Minutes define how long the EA will be halted. For example, if Haily Profit Halt EA Hours is 10, Daily Profit Halt EA Minutes is 20, then the EA will be halted for 10 hours and 20 minutes.

    If "Daily Profit Halt Time Type" is Halt Until, then Daily Profit Halt EA Until (Broker Time) defines how long the EA will be halted, the format is HH:MM:SS. For example if Daily Profit Halt EA Until (Broker Time) is 10:30:00, EA is halted before 10:30:00, e.g. 09:30:00, then EA will be reactivated at 10:30:00 the same day; if EA is halted after 10:30:00, e.g. 13:30:00, then EA will be reactivated at 10:30:00 next day. Please note, the time is your MT4/5 account's broker time.

    Daily Profit/Loss Check Time (Broker Time)

    "Daily Profit/Loss Check Time (Broker Time)" defines the time when EA recalcuates the equity as benchmark. Profit and loss are calculated based on the benchmark. It is broker time, the format is HH::MM. For example 09:00 means the equity will be checked at 09:00 every day as benchmark. The range is from 00:00 to 23:59. If you set it as 24:00, it means 23:59

    Check Equity at Start and Wakeup for Daily Profit/Loss

    If "Check Equity at Start and Wakeup for Daily Profit/Loss" is On, EA checks the equity at the start of EA and when EA wakes up from halt, then EA checks the equity at "Daily Profit/Loss Check Time" every day. For example if your "Daily Profit/Loss Check Time" is 10:00, you launch EA at 09:00, then the equity at 09:00 is checked and is used as benchmark equity. At 10:00, the equity is checked again and the new equity is used as benchmark equity. If the EA is halted because of daily profit/loss hits or cumulative profit/loss hits, then when EA wakes up, the equity will be checked and will be used as benchmark.

    If "Check Equity at Start and Wakeup for Daily Profit/Loss" is Off, EA does not check the equity at the start of EA or when EA wakes up from halt , EA only checks the equity at "Daily Profit/Loss Check Time" every day.


    Daily Profit Management example 1
    This picture shows example of how MT4/5 EA manages daily profit in terms of currency

    EA checks equity when launched, then checks equity at 09:00 (broker time) every day.

    Every time when the equity is checked, EA records it as the benchmark. Then if the profit is $200 more than the benchmark before next check, EA is halted for 24 hours and 30 minutes. When EA wakes up from halt, it checks the equity and records it as the banchmark.


    Daily Profit Management example 2
    This picture shows example of how MT4/5 EA manages daily profit in terms of percentage

    EA does not check equity when launched. EA only checks equity at 20:00 (broker time) every day.

    Every time when EA checks the equity, EA records it as the benchmark. Then if the profit is 10% more than the benchmark before next check, EA close all positions and is halt for 12 hours and 20 minutes

    If Magic Restriction is On, only positions created by this EA will be closed. If Magic Restriction is Off, all positions will be closed

    Daily Profit Management example 3: Halt Until

    Since version 2.12, you can use Halt Until to specify when the EA can wake up


    This picture shows example of how MT4/5 EA manages daily profit until some time

    EA does not check equity when launched. EA only checks equity at 20:00 (broker time) every day.

    Every time when EA checks the equity, EA records it as the benchmark. Then if the profit is 10% more than the benchmark before next check, EA close all positions and is halted until 09:30:00 broker time. If EA starts halting after 09:30:00, then it will wake up at 09:30:00 next day.

    If Magic Restriction is On, only positions created by this EA will be closed. If Magic Restriction is Off, all positions will be closed


    Daily Loss Management


    This is Trading Router MT4/5 EA settings for managing daily loss

    Daily Loss Management is similar as Daily Profit Management, it takes actions when daily loss goal is reached. It shares "Daily Profit/Loss Check Time (Broker Time) and "Check Equity at Start and Wakeup for Daily Profit/Loss" with Daily Profit Management.



    Cumulative Profit Management


    This is the section on Trading Router MT4/5 EA for managing cumulative profit

    Cumulative Profit Management set a goal for the total profit your account has earned since the start of TradingRouter EA. When the goal is achieved, actions will be taken. The actions include close all positions, halt the EA for a day, halt the EA for a specific time, and halt the EA forever. When the EA is at halt, you can use eaon command to reactivate the EA.

    Cumulative Profit Management has 7 inputs: "Cumulative Profit (0 means off)", "Cumulative Profit Type", "Cumulative Profit Action", "Cumulative Profit Halt Time Type", "Cumulative Profit Halt EA Hours", and "Cumulative Profit Halt EA Minutes", "Cumulative Profit Halt EA Until (Broker Time)"

    Cumulative Profit (0 means off)

    If "Cumulative Profit (0 means off)" is 0, then there is no goal for cumulative profit

    Cumulative Profit Type

    If "Cumulative Profit Type" is Percentage, the value of "Cumulative Profit" means percentage and profit is defined by percentage of the initial equity when EA starts

    If "Cumulative Profit Type" is Currency, the value of "Cumulative Profit" means amount of currency and profit is defined by currency of the initial equity when EA starts

    Cumulative Profit Action

    There are 7 options for action when cumulative profit goal is reached, "Halt EA (Day)", "Halt EA (Specify Time)", "Halt EA (Persistent)", "Close All Positons", "Close All Positons and Halt EA (Day)", "Close All Positons and Halt EA (Specify Time)" and "Close All Positons and Halt EA (Persistent)"


    This picture shows all the different methods of cumulative profit management

    If you choose "Halt EA (Day)" or "Close All Positons and Halt EA (Day)" the EA will be halted for 24 hours after the cumulative profit is reached

    If you choose "Halt EA (Specify Time)" or "Close All Positons and Halt EA (Specify Time)" the EA will be halted for a period specified by "Cumulative Profit Halt Time Type", "Cumulative Profit Halt EA Hours" , "Cumulative Profit Halt EA Minutes" and "Cumulative Profit Halt EA Until (Broker Time)" after the cumulative profit is reached

    If you choose "Halt EA (Persistent)" or "Close All Positons and Halt EA (Persistent)", the EA will be halted for ever after the cumulative profit is reached

    In any case, you can reactivate the EA by eaon command.

    Cumulative Profit Halt Time Type

    Cumulative Profit Halt EA Hours

    Cumulative Profit Halt EA Minutes

    Cumulative Profit Halt EA Until (Broker Time)New since version 2.12)

    If "Cumulative Profit Halt Time Type" is Halt Duration, then Cumulative Profit Halt EA Hours and Cumulative Profit Halt EA Minutes define how long the EA will be halted. For example, if Cumulative Profit Halt EA Hours is 10, Cumulative Profit Halt EA Minutes is 20, then the EA will be halted for 10 hours and 20 minutes.

    If "Cumulative Profit Halt Time Type" is Halt Until, then Cumulative Profit Halt EA Until (Broker Time) defines how long the EA will be halted, the format is HH:MM:SS. For example if Cumulative Profit Halt EA Until (Broker Time) is 10:30:00, EA is halted before 10:30:00, e.g. 09:30:00, then EA will be reactivated at 10:30:00 the same day; if EA is halted after 10:30:00, e.g. 13:30:00, then EA will be reactivated at 10:30:00 next day. Please note, the time is your MT4/5 account's broker time.

    When the EA is reactivated either by eaon or due to the halt timeout, the initial equity for cumulative profit/loss will be reset to the equity at the time of being reactivated. And the benchmark equity for daily profit/loss will be reset to the equity at the time of being reactivated if "Check Equity at Start and Wakeup for Daily Profit/Loss" is On


    Cumulative Profit Management example 1
    This picture shows how to stop trades for a day when cumulative profit is achieved in terms of currency

    When your cumulative profit is $200, the EA will halt for 24 hours


    Cumulative Profit Management example 2
    This picture shows how to stop trades for a day when cumulative profit is achieved in terms of percentage

    When your cumulative profit is 10% more than the initial equity, the EA will halt for 24 hours


    Cumulative Profit Management example 3
    This picture shows how to stop trades for a couple of hours when cumulative profit is achieved in terms of percentage

    When your cumulative profit is 10% more than the initial equity, the EA will halt for 3 hours and 40 minutes


    Cumulative Profit Management example 4: Halt Until
    This picture shows how to stop trades until some time when cumulative profit is achieved in terms of percentage

    When your cumulative profit is 10% more than the initial equity, the EA will halt until 09:30:00 broker time. If EA starts halting after 09:30:00, then it will wake up at 09:30:00 next day.


    Cumulative Profit Management example 5
    This picture shows how to stop trades forever when cumulative profit is achieved in terms of percentage

    When your cumulative profit is 10% more than the initial equity, the EA will halt forever. It can be reactivated by eaon command


    Cumulative Profit Management example 6
    This picture shows how to close all positions and stop EA for a day when cumulative profit is achieved

    When your cumulative profit is 10% more than the initial equity, all positions will be closed and the EA will halt for 24 hours



    Cumulative Loss Management


    This is the section on Trading Router MT4/5 EA for managing cumulative loss

    Cumulative Loss Management is similar to Cumulative Profit Management. It takes actions when the total loss of your account since the start of TradingRouter EA has reached a goal. The inputs are the same as Cumulative Profit Management.



    Multi Strategies Settings


    This picture show how to set Trading Router MT4/5 EA to work together with other EAs

    "EA Magic Number" is used to identify orders in this EA. You can run two TradingRouter EA with different "EA Magic Number", but it should be unique.

    If "Magic Restriction" is On, the action of this TradingRouter EA only affect the orders/positions created by this EA. If "Magic Restriction" is off, the action of this TradingRouter EA will affect all orders/positions including orders/positions created by other EA and created manually.

    The actions of TradingRouter EA which considers "Magic Restriction" are closeall, closealleaoff, closelongbuy, closeshortsell, newsltplong, newstpshort, closeshortpct, closelongpct, closeshortvol, closelongvol, cancellong, cancelshort, cancellongbuylimnit, cancellongbuystop, cancelshortselllimt, cancelshortsellstop, newsltpbuylimit, newsltpbuystop, newsltpselllimit, newsttpsellstop



    Miscellaneous Settings


    This is Miscellaneous Settings on Trading Router MT4/5 EA

    "Start Time (Broker Time)" and "End Time (Broker Time)" control when the EA should be active. The EA will only active afer Start Time and before End Time. If you want the EA to be active all the time, you can set Start Time to 00:00 and End Time to 24:00

    Prefix is added before symbol and Suffix is added after symbol. Set them to empty if there is no prefix or suffix for the symbol.


    Prefix Suffix example
    This picture shows how to add prefix and suffix in symbols in the received Tradingview alert messages
    • token=master19dd529542d4b79d2bc4, signal=buy, symbol=AUDUSD, risk_lots=0.1 (note: buy 0.1 lot of AUDUSD.min)


    News Impact Settings



    News Impact Settings on Trading Router MT4/5 EA

    Since version 2.08, you can set time duration for news impact. When it is the news impact time, all existing positions will be closed and pending orders will be deleted, and the EA will ignore any messages until the news impact time finishes.

    "Enable News Impact" is used to enable and disable the news impact feature. If it is true, the new impact feature is enalbe. The default is false.

    "Time Type" specifies if the news impact time is server time or terminal time. The default is server time.

    "Is News Impact File in Common Folder" specifies if your news impact file is in commond folder or in terminal folder. Check News Impact File Folder for details

    "News Impact File" specifies the name of your news impact file. For the content of this file, check News Impact File Syntax

    "News Impact Action" specifies the actions when news impact time comes. There are two actions, one action is "Close all and ignore messages" which will close all positions and pending orders and ignore messages in the news impact time. Another action is "Only ignore messages" which will ignore messages in the news impact time but does not close positions and orders.



    News Impact File Syntax

    Every line in the news impact file specifies a time section for news impact

    one line has 8 fields seperated by ",".

    The format of one line is like this "start time, end time, first day of week/or day of month, last day of week/or day of month, first month, last month, first date, last date

    The first two fields "start time" and "end time" specify the start and end time of the news impact, the format is like HH:MM:SS, For example if "start time" is 09:30:00 and "end time" is 10:00:00, it means the news impact time is from 09:30:00 am to 10:00:00 am. Usually you should set the "start time" a little bit earlier than news start time. For example, if there will be news from 09:00:00 to 09:30:00, you can set "start time" to 08:59:00 so that all positions can be closed before 09:00:00. If you set "Time Type" to server time, the "start time" and "end time" are server time; If you set "Time Type" to terminal time, the "start time" and "end time" are terminal time;

    The next two fields "first day of week/or day of month" and "last day of week/or day of month" specify which day of week or day of month the news impact time will be used. If you use any of MON, TUE, WED, THU, FRI, SAT, SUN, it will be interpreted as day of week, if you use number from 1 to 31, it will be interpreted as day of month. For example:

    • if the "first day of week/or day of month" and "last day of week/or day of month" is MON and FRI, it means the news impact will only work from Monday to Friday;
    • if the "first day of week/or day of month" and "last day of week/or day of month" is WED and WED, it means the news impact will only work for Wednesday;
    • if the "first day of week/or day of month" and "last day of week/or day of month" is 1 and 20, it means the news impact will work from 1st to 20th of a month.
    • if the "first day of week/or day of month" and "last day of week/or day of month" is 2 and 2, it means the news impact will work only on 2nd of a month.
    • If "first day of week/or day of month" is day of week, e.g. MON, TUE, the "last day of week/or day of month" must also be day of week.
    • If "first day of week/or day of month" is day of month, e.g. 1,2, 3, the "last day of week/or day of month" must also be day of month.
    • If "first day of week/or day of month" and "last day of week/or day of month" is not consistent, the news impact time of this line will be invalid. For example if "first day of week/or day of month" is 3 and "last day of week/or day of month" is FRI, they are not consistent and the news impact of this line is invalid.

    The next two fields "first month" and "last month" specify which months the news impact time will be used. It could be JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC. For example if "first month" and "last month" are APR and JUL, it means the news impact will be used form April to July.

    The last two fields "first date" and "last date" specify when the news impact feature can be used, it is like "yyyy.mm.dd". For example, if "first date" and "last date" are 2023.01.01 and 2024.05.30, it means the news impact feature can be used from 1st of January 2023 to 30th of May 2024. "first date" cannot be earlier than 1980.01.01, "last date" cannot be later than 2100.12.31.

    By set all the 8 fields, you can define one news impact time. A news impact file can have multi line, every line define a news impact time

    A news impact file can have more than one line, every line define a news impact time

    If your news impact time cross the overnight, you can use two news impact line to connect it, one ends with 23:59:59 and another starts with 00:00:00. Please see this example

    If you modified news impact file, you have to restart the EA to make your changes effective. For example, if you add one news impact time line or remove on news impact time line or changed the start time of a news impact time line, you have to remove the EA and launch the EA again to make your changes effective.



    news impact file example 1

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, FRI, FRI, MAY, MAY, 2024.05.15, 2024.05.31

    The "first date" and "last date" are 2024.05.15, 2024.05.31, so this news impact is active from 2024.05.15 to 2024.05.31

    The "first month" and "last month" are MAY, MAY, so this news impact is active on May

    The "first day of week/or day of month" and "last day of week/or day of month" are FRI, FRI, so this news impact is active on Friday

    The "start time" and "end time" are 08:59:00, 09:30:00, so this news impact time is from 08:59:00 am to 09:30:00 am

    Combining all these 8 fields, we can know that the news impact time is from 08:59:00 am to 09:30:00 am on Friday of May between 2024.05.15 and 2024.05.31, that is from 08:59:00 am to 09:30:00 am on Friday, 17 May 2024, from 08:59:00 am to 09:30:00 am on Friday, 24 May 2024 and from 08:59:00 am to 09:30:00 am on Friday, 31 May 2024



    news impact file example

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, FRI, FRI, JAN, DEC, 2024.01.01, 2024.12.31

    The news impact time is from 08:59:00 am to 09:30:00 am every Friday in every month from 2024.01.01 to 2024.12.31



    news impact file example

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, 3, 3, JAN, DEC, 2024.01.01, 2024.12.31

    The news impact time is from 08:59:00 am to 09:30:00 am every 3rd of every month from 2024.01.01 to 2024.12.31



    news impact file example

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, 3, 5, JAN, DEC, 2024.01.01, 2024.12.31

    The news impact time is from 08:59:00 am to 09:30:00 am every 3rd of every month, every 4th of every month and every 5th of every month from 2024.01.01 to 2024.12.31



    news impact file example

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, 3, 3, FEB, MAR, 2023.01.01, 2024.12.31

    The news impact time is from 08:59:00 am to 09:30:00 am on 3rd of February onf 3rd of March from 2023.01.01 to 2024.12.31, that is from 08:59:00 am to 09:30:00 am on 3rd of February 2023, on 3rd of March 2023, on 3rd of February 2024, and on 3rd of March 2024



    news impact file example

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, 10, 10, MAY, MAY, 2023.01.01, 2024.12.31

    The "first date" and "last date" are 2023.01.01, 2024.12.31, so this news impact is active from 2023.01.01 to 2024.12.23

    The "first month" and "last month" are MAY, MAY, so this news impact is active on May

    The "first day of week/or day of month" and "last day of week/or day of month" are 10, 10, so this news impact is active on 10th of a month

    The "start time" and "end time" are 08:59:00, 09:30:00, so this news impact time is from 08:59:00 am to 09:30:00 am

    Combining all these 8 fields, we can know that the news impact time is from 08:59:00 am to 09:30:00 am on 10th of May 2023 and from 08:59:00 am to 09:30:00 am on 10th of May 2024



    news impact file example multi lines

    Assuming the following is what is in the news impact file

    08:59:00, 09:30:00, 3, 3, JAN, DEC, 2023.01.01, 2024.12.31

    15:59:00, 15:30:00, 3, 3, JAN, DEC, 2023.01.01, 2024.12.31

    14:59:00, 14:30:00, 6, 6, JAN, DEC, 2023.01.01, 2024.12.31

    The news impact time is from 08:59:00 am to 09:30:00 am on 3rd of every month from 2023.01.01 to 2024.12.31, and from 15:59:00 am to 15:30:00 am on 3rd of every month from 2023.01.01 to 2024.12.31, and from 14:59:00 am to 14:30:00 am on 6th of every month from 2023.01.01 to 2024.12.31



    news impact file example multi lines, connect overnight

    Assuming the following is what is in the news impact file

    23:00:00, 23:59:59, THU, THU, JAN, DEC, 2023.01.01, 2024.12.31

    00:00:00, 01:00:00, FRI, FRI, JAN, DEC, 2023.01.01, 2024.12.31

    The news impact time is from 23:00:00 pm on every Thursday to 01:0:00 am next Friday from 2023.01.01 to 2024.12.31,



    News Impact File Folder

    Your new impact file can be saved in two places, , one is terminal folder, another is common folder

    If you put your news impact file in terminal folder, we should set "Is News Impact File in Common Folder" to false in the EA News Impact Settings, so that the EA will read the news impact file from the terminal folder.

    If you put your news impact file in common folder, we should set "Is News Impact File in Common Folder" to true in the EA News Impact Settings, so that the EA will read the news impact file from the common folder.

    If you want the terminal use its own news impact file, you can use terminal folder, if you want two or more terminals share the same news impact file, you can use the common folder,


    Terminal Folder

    You can follow the steps below to set your news impact file for terminal folder

    1. On terminal, click File => Open Data Folder
    2. Go to MQL5 folder if you use MT5, or go to MQL4 folder if you use MT4
    3. Go to Files folder
    4. Put your news impact file here
    5. On the EA settings, set "Is News Impact File in Common Folder" to false and input the news impact file name











    Common Folder

    You can follow the steps below to put your news impact file into common folder

    1. On terminal, click File => Open Data Folder
    2. Go to Terminal folder
    3. Go to Common folder
    4. Go to Files folder
    5. Put your news impact file here
    6. On the EA settings, set "Is News Impact File in Common Folder" to true and input the news impact file name














    Trouble Shooting

    No news time added log
    could not open the news impact file

    When your news impact file is loaded into EA, you should see messages like the above in Experts log. Every line in your news impact file should have one message in the Experts log

    If you cannot see any message, please check if you have enabled the news imapct by setting "Enable News Impact" to true in the EA settings



    Could not open news impact file
    could not open the news impact file

    If you see this message on the Experts log, it could be the following reason

    1. The news impact file folder is not correct. If you set "Is News Impact File in Common Folder" to false, the news impact file should be in terminal folder. If you set "Is News Impact File in Common Folder" to true, the news impact file should be in common folder
    2. The news impact file name is not correct. Check you input for "News Impact File" on the EA settings is the same file as what is in the terminal folder or common folder


    This news impact line is not processed(no field):
    no field in the news impact file

    If you see this message on the Experts log, it could be the following reason

    1. the line is empty in your news impact file


    This news impact line is not processed(no enough fields):
    no enough fields in the news impact file

    If you see this message on the Experts log, it could be the following reason

    1. the line in your news impact file does not have 8 fields


    This news impact line is not processed(invalid start time):
    invalid start time in the news impact file

    If you see this message on the Experts log, it could be the following reason

    1. The start time in the line is incorrect. The start time should be like HH:MM:SS, HH is from 00 to 23, MM is from 00 to 59 and SS is from 00 to 59. Minimum time is 00:00:00 and the maximum time is 23:59:59.


    This news impact line is not processed(invalid end time):
    invalid end time in the news impact file

    If you see this message on the Experts log, it could be the following reason

    1. The end time in the line is incorrect. The end time should be like HH:MM:SS, HH is from 00 to 23, MM is from 00 to 59 and SS is from 00 to 59. Minimum time is 00:00:00 and the maximum time is 23:59:59.


    This news impact line is not processed(start time later than end time):
    start time later than end time in the news impact file

    If you see this message on the Experts log, it could be the following reason

    1. The start time is a later time than the end time in the line. The start time should be earlier than the end time.


    This news impact line is not processed(invalid frequence):
    start time later than end time in the news impact file

    If you see this message on the Experts log, it means something is wrong in the "first day of week/or day of month" field or "last day of week/or day of month" field. It could be the following reason

    1. The "first day of week/or day of month" and "last day of week/or day of month" is not consistent. If you use Mon,Tue,...,FRI for "first day of week/or day of month", then you have use Mon,Tue,...,FRI for "last day of week/or day of month". If you use 1,2,...,30,31 for "first day of week/or day of month", then you have use 1,2,...,30,31 for "last day of week/or day of month".
    2. There may be typo in your day of week. For example you use TUES instead of TUE.
    3. The day of month is invalid. You have to use number from 1 to 31 for day of month. It is invalid if you use 32.
    4. The first day is later then last day. For example you use TUE, MON which is invalid because TUE is later then MON


    This news impact line is not processed(invalid month):
    start time later than end time in the news impact file

    If you see this message on the Experts log, it means something is wrong in the "first month" field or "last month" field. It could be the following reason

    1. There may be typo in your month. For example you use APP instead of APR.
    2. The first month is later then last month. For example you use MAY, MAR which is invalid because MAY is later then MAR


    This news impact line is not processed(invalid duration):
    start time later than end time in the news impact file

    If you see this message on the Experts log, it means something is wrong in the "first date" field or "last date" field. It could be the following reason

    1. The date format is wrong. The correct format is yyyy.mm.dd. For example, 2024.05.09, 2023.09.23
    2. The year is too small or too large. The year must be between 1980 and 2100. For example 1980..01.01 is correct but 1979.12.31 is wrong. 2100.12.31 is correct, but 2101.01.01 is wrong.
    3. It is not a valid date. For example 2023.02.29 is wrong because there is no 29th February for 2023. 2024.06.31 is wrong because there is no 31th of June, the last day of June is 30th.


    New Imapct Sample Files

    You can download the following sample files and test them. You can make your own news impact file by modifying the sample files

    Sample File 1
    Click news_impact_file_sample_1.txt to download the sample file

    The content of this file is

    09:29:00, 10:00:00, MON, MON, JAN, DEC, 1980.01.01, 2100.12.31
    16:29:00, 17:00:00, MON, MON, JAN, DEC, 1980.01.01, 2100.12.31
    12:29:00, 13:00:00, WED, WED, JAN, DEC, 1980.01.01, 2100.12.31
    10:29:00, 11:00:00, 4, 4, JAN, DEC, 1980.01.01, 2100.12.31
    14:59:00, 15:30:00, 6, 6, MAY,JUN, 1980.01.01, 2100.12.31

    This file has 5 news impact time

    1. from 09:29:00 to 10:00:00 every Monday
    2. from 16:29:00 to 17:00:00 every Monday
    3. from 12:29:00 to 13:00:00 every Wednesday
    4. from 10:29:00 to 11:00:00 on 4th of every month
    5. from 14:59:00 to 14:30:00 on 6th of May and 6th of June every year

    You can put the file news_impact_file_sample_1.txt in to terminal folder and set "News Impact File" to news_impact_file_sample_1.txt

    news impact sample file 1


    Sample File 2
    Click news_impact_file_sample_2.txt to download this sample file

    The content of this file is

    23:29:00, 23:59:59, MON, MON, JAN, DEC, 1980.01.01, 2100.12.31
    00:00:00, 00:30:00, TUE, TUE, JAN, DEC, 1980.01.01, 2100.12.31
    09:29:00, 10:00:00, TUE, TUE, JAN, DEC, 1980.01.01, 2100.12.31

    This file has 3 news impact time, the first two news impact times are connected, so there are actually two news impact time

    1. from 23:29:00 Monday to 00:30:00 next Tuesday
    2. from 09:29:00 to 10:00:00 every Tuesday

    You can put the file news_impact_file_sample_2.txt in to terminal folder and set "News Impact File" to news_impact_file_sample_2.txt

    news impact sample file 2


    Sample File 3
    Click news_impact_file_sample_3.txt to download this sample file

    The content of this file is

    09:29:00, 10:30:00, MON, MON, JUN, DEC, 2023.06.01, 2023.12.31
    09:29:00, 10:30:00, MON, MON, JAN, MAY, 2024.01.01, 2024.05.31
    09:29:00, 10:30:00, 6, 6, JUN, DEC, 2024.06.01, 2024.12.31
    09:29:00, 10:30:00, 6, 6, JAN, DEC, 2025.01.01, 2025.12.31

    This file has 4 news impact time, the first news impact time is every Monday from June to December 2023 and the second news impact time is every Monday from January to May 2024, the first news impact time and the second news impact time have the same start time/end time, hence the first news impact time and the second news impact time are connected. For the same reason, the third and fourth news impact time are also connected. Hence there are actually 2 news impact time in this file

    1. from 09:29:00 to 10:30:00 every Monday from June 2023 to May 2024.
    2. from 09:29:00 to 10:30:00 on 6th of every month from June 2024 to December 2025

    You can put the file news_impact_file_sample_3.txt in to terminal folder and set "News Impact File" to news_impact_file_sample_3.txt

    news impact sample file 3


    Net TP (Since version 2.11)

    Net TP Settings

    Net TP Settings on Trading Router MT4/5 EA

    Since version 2.11, You can set net take profit for a group of open positions. When the net profit of a group of open positions is hit, all the positions in this group will be closed

    The Net TP can be used in Grid strategy. No matter how many positions you have, all the positions will be closed at the same time if the net take profit of all the positions is hit. For example, your target net profit to $60 and you have 3 positions, the first position has $40 profit, the second position has $10 loss, the third position has $30 profit. The net profit of the 3 position is 40 - 10 + 30 = 60, which is your target profit, then all the 3 positions will be closed and you will get $60 profit.


    Depending on settings, the group could be the following:

    • All positions
    • All positions of the same direction(buy/sell)
    • All positions of the same symbol
    • All positions of the same symbol and same direction(buy/sell)
    • All positions of the same trid
    • All positions of the same trid and same direction(buy/sell)

    Please note, net take profit only work for open positions. Pending order will not be considered.

    "Enable Net Take Profit" is used to enable/disable the Net TP feature. If it is true, the Net TP feature is enabled otherwise Net TP feature is disabled. The default is false.

    "Net Take Profit Group Type": Define the group type where the net profit is calculated. There are three group types

    1. "Net TP On All Positions": The net profit is calculated on all positions. If Magic Restriction is On, the net profit is calculated on all positions those magic numbers are the same as EA Magic Number.
    2. "Net TP On Symbols": The net profit is calculated on groups of positions, the groups are specified by "Net Take Profit Symbols". If Magic Restriction is On, only positions whose magic numbers are the same as EA Magic Number are used to calculate the net profit.
    3. "Net TP On TRIDs": The net profit is calculated on groups of positions, the groups are specified by "Net Take Profit TRIDs". If Magic Restriction is On, only positions whose magic numbers are the same as EA Magic Number are used to calculate the net profit.

    "Net Take Profit Amounts": The amounts of take profit for groups. The amounts are separated by ",". The currency is your account currency.

    "Net Take Profit Symbols": This input is used if your "Net TP On All Positions" is "Net TP On Symbols".

    • It specify all symbols that are used for groups.
    • The symbols are separated by ",". Every symbol defines a group.
    • The max input length is 200 characters.
    • For example, if your "Net TP On All Positions" is "Net TP On Symbols" and you set the "Net Take Profit Symbols" input as EURUSD,GBPUSD, and set "Net Take Profit Amounts" as 60,75. Then when the net profit of all positions of EURUSD hits $60, all the EURUSD positions will be close. And when the net profit of all positions of GBPUSD hits $75, all the GBPUSD positions will be closed.

    "Net Take Profit TRIDs": This input is used if your "Net TP On All Positions" is "Net TP On TRIDs".

    • It specify all trids that are used for groups.
    • The trids are separated by ",". Every trid defines a group.
    • The max input length is 200 characters.
    • For example, if your "Net TP On All Positions" is "Net TP On TRIDs" and you set the "Net Take Profit TRIDs" input as id1,id2, and set "Net Take Profit Amounts" as 60,75. Then when the net profit of all positions whose trid is id1 hits $60, all these positions will be close. And when the net profit of all positions whose trid is id2 hits $75, all these positions will be closed.

    "Net Take Profit Distinguish Buy/Sell": This specifies if we split buy and sell. The default is false. If you set it to true, the buy and sell will be considered as different groups.

    "Net Take Profit Amounts for Sell": This field works together with "Net Take Profit Distinguish Buy/Sell". If "Net Take Profit Distinguish Buy/Sell" is false, you can keep "Net Take Profit Amounts for Sell" empty. If "Net Take Profit Distinguish Buy/Sell" is true, "Net Take Profit Amounts for Sell" specifies the amounts of take profit for sell groups and the previous "Net Take Profit Amounts" specifies the amounts of take profit for buy groups.

    For example, if your "Net TP On All Positions" is "Net TP On Symbols" and you set the "Net Take Profit Symbols" input as EURUSD,GBPUSD, and set "Net Take Profit Amounts" as 60,75, and set "Net Take Profit Distinguish Buy/Sell" to true, and set "Net Take Profit Amounts for Sell" as 80,92, Then

    • When the net take profit of all long positions of EURUSD hits $60, all the long EURUSD positions will be close.
    • When the net take profit of all short positions of EURUSD hits $80, all the short EURUSD positions will be close.
    • When the net take profit of all long positions of GBPUSD hits $75, all the long GBPUSD positions will be closed.
    • When the net take profit of all short positions of GBPUSD hits $92, all the short GBPUSD positions will be closed.

    Please Note,

    • If your "Net Take Profit Group Type" is "Net TP On All Positions", the "Net Take Profit Amounts" should have only one amount.
    • If your "Net Take Profit Group Type" is "Net TP On Symbols", the "Net Take Profit Amounts" should have the same number of amounts as the number of symbols in "Net Take Profit Symbols" feilds. All symbols should be unique. If you accidentally put duplicate symbols, the one with smaller take profit will take effect.

      Duplicate symbols

      In the above example, there are two EURUSD in this settings, the first EURUSD has net take profit 10, the second EURUSD has net take profit 30. The net take profit 10 will take effect.

    • If your "Net Take Profit Group Type" is "Net TP On Symbols" and "Net Take Profit Distinguish Buy/Sell" is true, and you accidentally put duplicate symbols, the one with smaller take profit in "Net Take Profit Amounts" will take effect for buy order, the one with smaller take profit in "Net Take Profit Amounts for Sell" will take effect for sell order,

      Duplicate symbols for sell

      In the above example, there are two EURUSD in this settings, the first EURUSD's net take profit in "Net Take Profit Amounts" is 10, the second EURUSD's net take profit in "Net Take Profit Amounts" 30. The net take profit 10 will take effect for buy order of EURUSD.
      The first EURUSD's net take profit in "Net Take Profit Amounts for Sell" is 60, the second EURUSD's net take profit in "Net Take Profit Amounts for Sell" 20. The net take profit 20 will take effect for sell order of EURUSD.

    • If your "Net Take Profit Group Type" is "Net TP On TRIDs", the "Net Take Profit Amounts" should have the same number of amounts as the number of trids in "Net Take Profit TRIDs" feilds. All trids should be unique. If you accidentally put duplicate trids, the one with smaller take profit will take effect.

      Duplicate trids

      in the above example, there are two id1 in this settings, the first id1 has net take profit 10, the second id1 has net take profit 30. The net take profit 10 will take effect.

    • If your "Net Take Profit Group Type" is "Net TP On TRIDs" and "Net Take Profit Distinguish Buy/Sell" is true, and you accidentally put duplicate trids, the one with smaller take profit in "Net Take Profit Amounts" will take effect for buy order, the one with smaller take profit in "Net Take Profit Amounts for Sell" will take effect for sell order,

      Duplicate trids for sell

      In the above example, there are two id1 in this settings, the first id1's net take profit in "Net Take Profit Amounts" is 10, the second id1's net take profit in "Net Take Profit Amounts" 30. The net take profit 10 will take effect for buy order of id1.
      The first id1's net take profit in "Net Take Profit Amounts for Sell" is 60, the second id1's net take profit in "Net Take Profit Amounts for Sell" 20. The net take profit 20 will take effect for sell order of id1.

    • If your "Net Take Profit Distinguish Buy/Sell" is true, the "Net Take Profit Amounts" should have the same number of amounts as "Net Take Profit Amounts for Sell"

    The number of symbols and amounts are not the same

    This is a wrong setting. There are three symbols EURUSD,AUDUSD,GPBUSD but there are 4 amounts 25,60,29,30


    The number of trids and amounts are not the same

    This is a wrong setting. There are three trids id1,id2,id3 but there are 4 amounts 25,60,29,30


    All positions type can only have one amount

    This is a wrong setting. "Net Take Profit Group Type" is "Net TP On All Positions", but there are two amounts in "Net Take Profit Amounts"


    Amount for sell not same number as Amount

    This is a wrong setting. "Net Take Profit Distinguish Buy/Sell" is true, "Net Take Profit Amounts" has 2 amounts, but "Net Take Profit Amounts for Sell" has 3 amounts.

    Net TP Examples


    Net Profit Example, All Positions, Magic Restriction Off

    This picture shows Trading Router MT4/5 EA settings for net tp. It has no magic number, tp is for all positions

    Assuming your account currency is $. In this settings, the net take profit for all positions is $35. So when the net profit of all positions hits $35, all the positions will be closed.


    Net Profit Example, All Positions, Magic Restriction On

    This picture shows Trading Router MT4/5 EA settings for net tp. It has magic number, tp is for all positions

    Assuming your account currency is $. In this settings, the Magic Restriction is On and the EA Magic Number is 100. The net take profit for all positions is $35. So when the net profit of all positions whose magic number is 100 hits $35, all the positions whose magic number is 100 will be closed.


    Net Profit Example, All Positions, Magic Restriction On, Distinguish Buy/Sell

    This picture shows Trading Router MT4/5 EA settings for net tp. It has magic number, tp is for all positions. It distinguish buy/sell

    Assuming your account currency is $. In this settings, the Magic Restriction is On and the EA Magic Number is 100. The Net Take Profit Distinguish Buy/Sell is true and Net Take Profit Amounts for Sell is 60. The Net Take Profit Amounts is 35. So the take profit is $35 for long positions and $60 for short positions.

    When the net profit of all long positions(whose magic number is 100) hits $35, all these long positions will be closed.

    When the net profit of all short positions(whose magic number is 100) hits $60, all these short positions will be closed.


    Net Profit Example, Symbols, Magic Restriction On

    This picture shows Trading Router MT4/5 EA settings for net tp. It has magic number, tp is for symbols groups.

    Assuming your account currency is $. In this settings, the Magic Restriction is On and the EA Magic Number is 100.

    Net Take Profit Group Type is Net TP On Symbols

    Net Take Profit Symbols has EURUSD,GBPUSD,AUDUSD, so the net take profit will be calculated on 3 groups. The first group is for symbol EURUSD, the second group is for symbol GBPUSD and the last group is for symbol AUDUSD.

    Net Take Profit Amounts has 35,40,25, so the EURUSD group has net tp $35, the GBPUSD group has net tp $40 and the AUDUSD group has net tp $25

    • When the net profit of all EURUSD positions (whose magic number is 100) hits $35, all these EURUSD positions will be closed.
    • When the net profit of all GBPUSD positions (whose magic number is 100) hits $40, all these GBPUSD positions will be closed.
    • When the net profit of all AUDUSD positions (whose magic number is 100) hits $25, all these AUDUSD positions will be closed.

    Net Profit Example, Symbols, Magic Restriction On, Distinguish Buy/Sell

    This picture shows Trading Router MT4/5 EA settings for net tp. It has magic number, tp is for symbols groups. It distinguish buy/sell

    Assuming your account currency is $. In this settings, the Magic Restriction is On and the EA Magic Number is 100.

    Net Take Profit Group Type is Net TP On Symbols

    Net Take Profit Distinguish Buy/Sell is true

    Net Take Profit Symbols has EURUSD,GBPUSD,AUDUSD.

    Net Take Profit Amounts has 35,40,25

    Net Take Profit Amounts for Sell has 28,36,50

    So the net take profit will be calculated on 6 groups

    • The first group is all EURUSD long positions (whose magic number is 100), the target net take profit of this group is $35.
      When net profit of all EURUSD long positions (whose magic number is 100) hits $35, all these EURUSD long positions will be closed.

    • The second group is all EURUSD short positions (whose magic number is 100), the target net take profit is $28
      When net profit of all EURUSD short positions (whose magic number is 100) hits $28, all these EURUSD short positions will be closed.

    • The third group is all GBPUSD long positions (whose magic number is 100), the target net take profit is $40
      When net profit of all GBPUSD long positions (whose magic number is 100) hits $40, all these GBPUSD long positions will be closed.

    • The fourth group is all GBPUSD short positions (whose magic number is 100), the target net take profit is $36
      When net profit of all GBPUSD short positions (whose magic number is 100) hits $36, all these GBPUSD short positions will be closed.

    • The fifth group is all AUDUSD long positions (whose magic number is 100), the target net take profit is $25
      When net profit of all AUDUSD long positions (whose magic number is 100) hits $25, all these AUDUSD long positions will be closed.

    • The sixth group is all AUDUSD short positions (whose magic number is 100), the target net take profit is $50
      When net profit of all AUDUSD short positions (whose magic number is 100) hits $50, all these AUDUSD short positions will be closed.

    Net Profit Example, TRIDs, Magic Restriction On

    This picture shows Trading Router MT4/5 EA settings for net tp. It has magic number, tp is for trids groups.

    Assuming your account currency is $. In this settings, the Magic Restriction is On and the EA Magic Number is 100.

    Net Take Profit Group Type is Net TP On TRIDs

    Net Take Profit TRIDs has id1,id2,id3, so the net take profit will be calculated on 3 groups. The first group is for trid=id1, the second group is for trid=id2 and the last group is for trid=id3.

    Net Take Profit Amounts has 35,40,25, so the id1 group has net tp $35, the id2 has net tp $40 and the id3 group has net tp $25

    • When the net profit of all positions whose trid is id1 (whose magic number is 100) hits $35, all these positions whose trid is id1 will be closed.
    • When the net profit of all positions whose trid is id2 (whose magic number is 100) hits $40, all these positions whose trid is id2 will be closed.
    • When the net profit of all positions whose trid is id3 (whose magic number is 100) hits $25, all these positions whose trid is id3 will be closed.

    Net Profit Example, TRIDs, Magic Restriction On, Distinguish Buy/Sell

    This picture shows Trading Router MT4/5 EA settings for net tp. It has magic number, tp is for trids groups. It distinguish buy/sell

    Assuming your account currency is $. In this settings, the Magic Restriction is On and the EA Magic Number is 100.

    Net Take Profit Group Type is Net TP On TRIDs

    Net Take Profit Distinguish Buy/Sell is true

    Net Take Profit TRIDs has id1,id2,id3

    Net Take Profit Amounts has 35,40,25

    Net Take Profit Amounts for Sell has 28,36,50

    So the net take profit will be calculated on 6 groups

    • The first group is all long positions whose trid is id1 (whose magic number is 100), the target net take profit of this group is $35.
      When net profit of all long positions whose trid is id1 (whose magic number is 100) hits $35, all these long positions whose trid is id1 (whose magic number is 100) will be closed.

    • The second group is all short positions whose trid is id1 (whose magic number is 100), the target net take profit is $28
      When net profit of all short positions whose trid is id1 (whose magic number is 100) hits $28, all these short positions whose trid is id1 (whose magic number is 100) will be closed.

    • The third group is all long positions whose trid is id2 (whose magic number is 100), the target net take profit of this group is $40.
      When net profit of all long positions whose trid is id2 (whose magic number is 100) hits $40, all these long positions whose trid is id2 (whose magic number is 100) will be closed.

    • The fourth group is all short positions whose trid is id2 (whose magic number is 100), the target net take profit is $36
      When net profit of all short positions whose trid is id2 (whose magic number is 100) hits $36, all these short positions whose trid is id2 (whose magic number is 100) will be closed.

    • The fifth group is all long positions whose trid is id3 (whose magic number is 100), the target net take profit of this group is $25.
      When net profit of all long positions whose trid is id3 (whose magic number is 100) hits $25, all these long positions whose trid is id3 (whose magic number is 100) will be closed.

    • The sixth group is all short positions whose trid is id3 (whose magic number is 100), the target net take profit is $50
      When net profit of all short positions whose trid is id3 (whose magic number is 100) hits $50, all these short positions whose trid is id3 (whose magic number is 100) will be closed.


    Net SL(Since version 2.11)

    Net SL Settings on Trading Router MT4/5 EA

    Net SL is exactly the same as Net TP, except that all settings is for stop loss and when the net stop loss of a group of open positions is hit, all the positions in this group will be closed.

    Please refer to Net TP for reference.



    Auto Volume

    Auto Volume Settings on Trading Router MT4/5 EA

    Since version 2.12, You can let trade volume increase or decrease when you keep making profit or losing.

    Auto Volume only works for market orders, which are buy signal and sell signal

    The first time when a market order command comes(buy or sell signal), EA will use "Initial Volume" as volume for the order. Afterwards when a market order command comes (buy or sell signal), the EA will compare the current balance with the balance when previous market order command came. If the current balance is more than previous balance and the difference is more than "Profit Threshold", EA will use the formula in "Volume Change On Profit" to determine a new volume; if the current balance is less than previous balance and the difference is more than "Loss Threshold", EA will use the formula in "Volume Change on Less" to determine a new volume.

    For example, your account balance is $1000, the first buy/sell command comes and make an order of 0.1 lot. The second buy/sell command comes and your balance is still $1000, so the second order is still 0.1 lot. Then your first order hits take profit and closes and your balance becomes $1020. The third buy/sell command comes, because now balance ($1020) is greater than last time ($1000) , the third command will use a new volume decided by "Volume Change On Profit". Then your second order hits stop loss and closes and your balance becomes $1010. The fourth buy/sell command comes, because now balance ($1010) is less than last time ($1020), the fourth comand will use a new volume decided by "Volume Change On Loss".

    Please note, for most brokers, balance is unchanged after you open a position. But there are brokers which decrease balance after you open a position. If your broker decrease balance after opening a position, it is recommended you only have one position at a time, that is you close current position then open a new position. Or you can set "Loss Threshold" to a higher value so that the decreased balance does not exceed the "Loss Threshold".

    Enable Auto Volume

    "Enable Auto Volume" is used to enable/disable the Auto Volume feature. If it is true, the Auto Volume feature is enabled otherwise Auto Volume feature is disabled. The default is false.

    Initial Volume

    "Initial Volume" defines the volume for the first buy/sell command

    Volume Change On ProfitNew since version 2.12)

    "Volume Change On Profit" defines how new volume is decided when there is profit, it has the following syntax.

    1 a value with a preceding plus sign, e.g. +0.03 The new volume is previous volume plus a value. For example "Volume Change On Profit" is "+0.02", then new volume will be previous volume plus 0.02 lots
    2 a value with a preceding minus sign, e.g. -0.1 The new volume is previous volume minus a value. For example "Volume Change On Profit" is "-0.02", then new volume will be previous volume minus 0.02 lots
    3 a value without a preceding sign, e.g. 0.02 The new volume is exactly the value. For example "Volume Change On Profit" is "0.02", then new volume will be 0.02 lots
    4 a value with a preceding multiplication sign, e.g. *2 The new volume is previous volume multiplies a value. It can be any positive value. For example, "Volume Change On Profit" is "*1.5", then new volume will be previous volume times 1.5; "Volume Change On Profit" is "*0.5", then new volume will be previous volume times 0.5
    5 a first value with a preceding multiplication sign and a second value with a preceding plus sign, e.g. *2+0.01 The new volume is previous voluem multiplies the first value then plus the second value. The first and second values can be any positive values. For example, "Volume Change On Profit" is "*1.5+0.01", then new volume will be previous volume times 1.5 then plus 0.01 lots; "Volume Change On Profit" is "*0.5+0.03", then new volume will be previous volume times 0.5 then plus 0.03 lots
    6 a first value with a preceding multiplication sign and a second value with a preceding minus sign, e.g. *2-0.02 The new volume is previous voluem multiplies the first value then minus the second value. The first and second values can be any positive values. For example, "Volume Change On Profit" is "*1.5-0.01", then new volume will be previous volume times 1.5 then minus 0.01 lots; "Volume Change On Profit" is "*0.5-0.03", then new volume will be previous volume times 0.5 then minus 0.03 lots

    There was a parameter "Increase Volume" before version 2.12, it has been obsolete since version 2.12, you should use Volume Change On Profit instead

    Profit ThresholdNew since version 2.12)

    "Profit Threshold" is the smallest increase of the balance that can trigger new volume, the unit is your account currency unit. For example, "Profit Threshold" is "2", then new volume will be used only when balance is increased by more than 2

    Volume Change On LossNew since version 2.12)

    "Volume Change On Loss" defines how new volume is decided when there is loss. Its syntax is the same as "Volume Change On Profit", please refer "Volume Change On Profit" for syntax.

    There was a parameter "Decrease Volume" before version 2.12, it has been obsolete since version 2.12, you should use Volume Change On Loss instead

    Loss ThresholdNew since version 2.12)

    "Loss Threshold" is the smallest decrease of the balance that can trigger new volume, the unit is your account currency unit. For example, "Loss Threshold" is "2", then new volume will be used only when balance is decreased by more than 2

    Minimum Volume

    "Minimum Volume" defines the minimum volume than can be reached. For example if "Minimum Volume" is 0.2, you get profit or loss, the Volume Change On Profit or Volume Change On Loss calculates a new volume which is 0.1 lots and is less than 0.2 lots, then the new volume is set to 0.2 lots.

    Maximum Volume

    "Maximum Volume" defines the maximum volume than can be reached. For example if "Maximum Volume" is 0.5, you get profit or loss, the Volume Change On Profit or Volume Change On Loss calculates a new volume which is 0.7 lots and is more than 0.5 lots, then the new volume is set to 0.5 lots.

    Please note, if the Initial Volume is less than Minimum Volume, the Minimum Volume will be used as the volume for the first buy/sell command. If Initial Volume is greater than Maximum Volume, the Maximum Volume will be used as the volume for the first buy/sell command.

    Please note, when you enable Auto Volume feature, all other settings about volume (risk_lots=, risk_cncy_amt=, risk_pct_bal_loss_, risk_pct_bal_mgn=, risk=) will be ignored. For example, if your buy/sell command has field risk_lots=, the volume defined in risk_lots will be ignored. But your buy/sell command must have risk_lots= field, otherwise the command will not be executed. So you can set any value for risk_lots=, usually you can use risk_lots=1. If you enable Auto Volume and choose "On -- Netting" for Close On Reverse, an incomding buy/sell will close the same volume of opposite positions for the same symbol. If the incoming order's volume is less than or equal to all opposite positions, no new position will be made. If the incoming order's volume is more than all opposite positions, then the incoming order will create a position with volume decided by Auto Volume feature. So if you enable Auto Volume, it is suggested that you don't use "On -- Netting" for "Close On Reverse".

    It is highly recommended that you stick to one symbol when using Auto Volume feature, because different symbols have different minimum lot. For example if symbol A's minimum lot is 0.01 lot and symbol B's minimum lot is 0.1 lot, your set Volume Change On Profit to "*5", your first order is 0.01 lot of symbol A and closes with profit, your second order is for symbol B, the Auto Volume will set the volume to 0.05 lot for symbol B, but symbol B's minimum lot is 0.1, so it is round to 0.1 lot of symbol B; the second order for symbol B also closes with profit, the third order is for symbol A, the Auto Volume will set volume to 0.5 lot for symbol A which is 50 times as the first symbol A order.

    Auto Volume example 1
    Example to show how to set Auto Volume

    The first order has volume 0.01, if first order closes with profit more than 1, the second order will have volume 0.02 lots. If the first order closes with loss more than 2, the second order will have volume 0.01*2 plus 0.01 which is 0.03 lots



    Signal Filter

    Signal Filter Settings on Trading Router MT4/5 EA

    Since version 2.11, You can filter out signals, which means the EA can ignore some signals

    "Enable Signal Filter" is used to enable/disable the Signal Filter feature. If it is true, the Signal Filter feature is enabled otherwise Signal Filter feature is disabled. The default is false.

    "Ignored Signals" defines the signals to be ignored. Signals are separated by ",", the maximum input length is 200 characters

    You can ignore any signals except eaon and eaoff

    Ignored Signals Example

    In the above settings, the four signals will be ignored: sell, closelongvol, selllimit, closelong

    Hence, the following messages will be ignored

    • token=master19dd529542d4b79d2bc4, signal=sell, symbol=EURUSD, risk_lots=0.1
    • token=master19dd529542d4b79d2bc4,signal=closelongvol, symbol=EURUSD, risk=0.1
    • token=master19dd529542d4b79d2bc4, signal=selllimit, symbol=EURUSD, price_exact=1.231, risk_lots=0.1
    • token=master19dd529542d4b79d2bc4,signal=closelong,symbol=EURUSD

    The End