TradingView To MT4/MT5 Signal & Trade Copier

TradingView To MT4/MT5 Signal & Trade Copier

31 March 2022, 02:02
Tsung Che Kuo
9
2 188


This is the user guide for 'TradingView To MT4' & 'TradingView To MT5' Copier EA.


This signal/trade copier for TradingView -> MetaTrader consists of three parts:


1. Google chrome browser at your computer


2. Copier EA as you purchase from MetaQuotes Market.   

(a) MT5 purchase link  and  MT4 purchase link 

(b) Evaluation copy can be found at the bottom of this blog that is *limited* to USDJPY trade copy only. 


3. Bridge app running over Windows 64-bit OS (e.g. Windows 10 or 11 or Windows Server)


    That bridge app will seamlessly scan TradingView alert popup at Google Chrome and feedback to this Copier EA for trade process (through secured data interchange).

    The reason to use TradingView alert popup is that's available for all users - while other alert approach, e.g. webhook, might be applicable only for paid members.


    If any question, you could send message at my profile page or telegram.


    1. Please download Google Chrome browser if you haven't it at your computer.


    2. Download the bridge app from here


    3. This zip file contains the bridge app called TVToMT.  Unzip TVToMT.zip.  


    4. Open any MT4/MT5 chart and attach that Copier EA to chart.  Please do this step before start the bridge app.


    > Please attach this copier EA to one MT4 or MT5 chart ONLY.  One copier EA can accommodate multiple TradingView chart alerts.


    5. Go to TVToMT folder and start TVToMT.  


    6. Click Start button of bridge app. 




    It will auto start your Chrome browser with tradingview home page.  Chrome window size can be set at config.ini file at TVToMT folder - but will need to restart the bridge app to effect.



    7. Login your tradingview account.

    please note that -

    this design is NOT applicable for TradingView Gmail account.  In case you're using Gmail for TradingView, please register another free email account for this signal copy purpose.

    TradingView's alert popup feature is available for all users.  


    > If you're using the evaluation version of copier EA, this bridge app will only fetch TradingView alert signals on USDJPY chart.


    8. Enable alert at your TradingView indicator - click 'Add alert on xxxx'




    9. Click 'Show pop-up'


    10.  Then the bridge app will start scanning if alert popup occurs.  Once alert is detected, it will show on the log window and feedback to Copier EA for further trade process.



    11.  Please be aware the time stamp shown on bridge app is slightly different with alert time on TradingView.

    TradingView uses their server time - while bridge app uses your computer time.  You could compare the TradingView's bar leftover time vs your computer time

    Or you could do self calibrate your computer time to minimize the difference.



    12. Below illustrations show the live trade copy at MT4/MT5:






    Quick hands-on

    1. At MetaTrader side: an MT4 or MT5 demo account and have this Copier ea on chart.

    2. Start the bridge app.

    3. At TradingView side:

    Open any 1-min chart

    Make an 'AlertTest' script from below codes and attach to chart:


    //@version=5
    
    indicator(title = "AlertTest", overlay = true)
    
    sigBuy = close >= open
    sigSell = close < open
    
    if sigBuy
        alert("Bullish candle, BUY", alert.freq_once_per_bar_close)
    if sigSell
        alert("Bearish candle, SELL", alert.freq_once_per_bar_close)
    
    plot(close, color = na)


    4. Enable alert feature.  This script will raise a buy alert for a bullish candle or sell for bearish.

    5. Check MT4/MT5 side if any trade action is made.


    For other details how to modify your alert messages to work with this copier, please refer to my another blog:

    "how to manipulate tradingview indicator strategy alert words




    MT4/MT5 copier settings:


    Lots mode - 3 options: 'fixed lots', 'Lots by equity percentage', 'Lots by loss percentage', each has its own variable to set.


    Symbol mapping list - that's for special trade symbol mapping.  if that's not set, EA will use the same symbol name from TradingView for trade.

    if MT4 has different symbol name, you could set by,

    for instance

    XAUUSD,GOLD;WTI,USOIL; 

    TradingView symbol of XAUUSD alert will be mapped to MT4's symbol of GOLD.

    each symbol uses ',' comma as seperator. First symbol is TradingView's while the second is MT4's. each pair uses ';' semicolon as separator.


    Close trade by opposite signal - default is true; will close trade if opposite signal.  you could turn that off if that's not your preference

    Reverse trade - default is false; if turned 'true', ea will place SHORT trade if LONG signal


    TakeProfit in point - default is 1000 points; if setting zero, no tp price will be set.

    StopLoss in point - default is zero, i.e. no sl price will be set

    Group take profit in $ - take profit by group of trades in $ amount

    Group stop loss in $ - take loss by group of trade in $ amount

    Trailing stop switch - default is false, i.e. disabled 

    Use ATR as SL- default is false; Use ATR value x its multiplier as SL price; Need to set its applied timeframe.

    Use SL ratio for TP- default is false; Use SL price distance to order open price multiplied by a ratio to be TP price.


    Keywords for LONG or SHORT trade - EA has listed some common keywords to identify an alert message as a LONG or SHORT signal.  you could supplement your own.

    Excluded keywords from opening trade - NOT to open trade if those keywords are shown at messages.

    Enable close trade keywords - enable keyword check to close trade.

    Keywords to close LONG or SHORT trade - EA close trades for those keywords.


    Taking TP price from TradingView

    default is off.  If enabled, the copier EA will use the TP prices described at TradingView signal texts.

    Taking SL price from TradingView

    default is off.  If enabled, the copier EA will use the SL prices described at TradingView signal texts.


    * For instance, if the TP/SL price text format at TradingView signals is

    TP: 1.06218, SL: 1.03218

    To parse this content, below variablesshould be set as

    TP price head stringset as

    TP:

    TP price tail stringset as

    ,

    SL price head stringset as

    SL:

    SL price tail string

    (left as blank)


    * Please note that SL setting priority is (a) Use TradingView's, (b) ATR SL, (c) SL point.  

    TP setting priority is (a) Use TradingView's, (b) Use SL ratio for TP, (c) TP point.


    Allowed symbol list from TradingView alerts -

    default is the blank string. it will take all symbol alerts from TradingView. if setting a string of allowed symbols, this copier ea will only accept the alert signals of those symbols.  if symbol more than one, add comma in between, e.g. EURUSD,GBPUSD.  but 'symbol mapping list' is required to set up if MT4/MT5 has different symbol name.


    Alert and panel setting variables are self explanatory.



    SPECIAL NOTE FOR TRADINGVIEW STRATEGY ALERT SETTING


    1.  Just simply follow the default message format at the popup setting - that will contain 'buy' 'sell' keywords at popup messages that could well used by MT4/MT5 copier.




    2. If you want to *CUSTOMIZE* TradingView messages, you could either modify your strategy pinescript codes with whatever alert messages you want

    or

    follow TradingView article "Strategy Alerts" (please google 'TradingView Strategy Alerts' to get this link) to set the alert formats.  


    Below illustrates the latter approach.  At below strategy screenshot example, this strategy has put below words at its strategy entry & exit 'comments':


    LONG entry - KltChLE

    SHORT entry - KltChSE

    Long exit - TYPE:LX

    SHORT exit - TYPE:SX




    As such just simply have the same words with strategy entry/exit comments - by typing {{strategy.order.comment}} when you set up strategy alert popup.





    At MT4/MT5 copier ea setting, add below keywords for those variables.  certainly for your strategy, those words would be different with this example.


    'Keywords for LONG trade' - add KltChLE

    'Keywords for SHORT trade' - add KltChSE

    'Keywords to close LONG trade' - add TYPE:LX

    'Keywords to close SHORT trade' - add TYPE:SX


    please remember to add a comma ',' with other keywords at those settings.



    Share it with friends: