# Using MT4 to Send Trading Stock Signals to C2

**URL:** <https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093>\
**Category:** C2\
**Created:** [June 17, 2015, 1:01am UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093 "2015-06-17T01:01:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Uncle](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/adrian_uncle/32/238_2.png) [@Adrian\_Uncle](https://forums.collective2.com/u/Adrian_Uncle)\
**Post date:** [June 17, 2015, 1:01am UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/1 "2015-06-17T01:01:25Z")

</div>

Recently, MT4 has offered futures and CFDs. I understand that C2 does not support futures or CFDs for MetaTrader.

I have modified the C2MT4 script so that it will send “AAPL” symbol to Collective 2. Basically, I will be sending Apple stock trading signals and not CFDs for MetaTrader.

Please let me know if this will work.

#import "C2MT4Connector.dll"  
string C2Init2(string c2InterfaceHost, string email, string password, string systemid, double c2LotMultiplier, string eaVersion, string terminal\_data\_path, string terminal\_commondata\_path, string reserve );  
string C2OrderOpen(string email, string password, string systemid, int orderid, string symbol, int cmd, double volume, double price, double stoploss, double takeprofit, string timeStamp, string mt4OrderComment);  
string C2OrderClose(string email, string password, string systemid, int orderid, string symbol, int cmd, double volume, double closePrice, string mt4OrderComment);  
int C2ReadResponses();  
string C2NextResponse();  
#import

extern string C2SystemID = “”;  
extern string C2Email = “”;  
extern string C2Password = “”;  
extern double C2LotMultiplier = 10;  
extern string C2InterfaceHost = “[ts.collective2.com](http://ts.collective2.com)”;

---

<div class="post-metadata">

**Author:** ![BobSvancara](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/bobsvancara/32/547_2.png) [@BobSvancara](https://forums.collective2.com/u/BobSvancara)\
**Post date:** [June 17, 2015, 2:56pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/3 "2015-06-17T14:56:21Z")

</div>

Hello,

we can do that.

But we need to know how to convert MT4 symbols to Collective2 symbols.

See [https://collective2.com/symbols](https://collective2.com/symbols)

Perhaps the right way is to create a new set of functions like above and add two or three parameters:

1. Collective2Symbol
2. TypeOfSymbol
3. Exchange

where

- Collective2Symbol is a symbol known to Collective2
- TypeOfSymbol is “stock”, “forex”, “futures”, …
- Exchange is “US” for US symbols or “LSE”, “MEFF”, “ASX”, … for foreign exchanges.

Is it viable?

---

<div class="post-metadata">

**Author:** ![Adrian\_Uncle](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/adrian_uncle/32/238_2.png) [@Adrian\_Uncle](https://forums.collective2.com/u/Adrian_Uncle)\
**Post date:** [June 17, 2015, 3:49pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/4 "2015-06-17T15:49:12Z")

</div>

Bob,

Thanks for your prompt reply.

There will be no need to convert MT4 symbols to Collective2 symbols as I will be sending exact stock trading symbol to the C2MT4Connector.dll

```
  if(trading_function >= OP_BUY )
      {
         if (trading_function == 0) 
         {
         result= OrderSend(_Symbol,OP_BUY,Lots,Ask,Slippage,sl,tp,sOP+" "+(string)b_magic[ind],b_magic[ind],0,clOP);
         C2OrderOpen(C2Email, C2Password, C2SystemID, result, "AAPL", OP_BUY, Lots, Ask, 0.0, 0.0, "", "");
         ReadCollective2Responses();
    
         }
         
         if (trading_function == 1) 
         {
         result= OrderSend(_Symbol,OP_SELL,Lots,Bid,Slippage,sl,tp,sOP+" "+(string)b_magic[ind],b_magic[ind],0,clOP);
         C2OrderOpen(C2Email, C2Password, C2SystemID, result, "AAPL", OP_SELL, Lots, Bid, 0.0, 0.0, "", "");
         ReadCollective2Responses();
         }
      }
      trading_function = -1; 
   }
}

    void CloseSelect()
    {
        int ticket = OrderTicket();
        C2OrderClose(C2Email, C2Password, C2SystemID, ticket, "AAPL", OrderType(), Lots, OrderClosePrice(), ""); 
        ReadCollective2Responses();
       if(OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,clrGold)) //--- Request successfully completed 
       {
          Alert("Position has been successfully closed!!");
       }
       else
       {
          Alert("The position close request could not be completed");
       }
    }
```

---

<div class="post-metadata">

**Author:** ![Adrian\_Uncle](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/adrian_uncle/32/238_2.png) [@Adrian\_Uncle](https://forums.collective2.com/u/Adrian_Uncle)\
**Post date:** [June 17, 2015, 3:58pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/5 "2015-06-17T15:58:02Z")

</div>

Do I need to send the exchange name if I were to trade the following symbols?

“SJM”, “VTR”, “TSO”, “LNG”, and etc…

Symbol Desc ription  
SJM \_\_\_\_\_ J.M. SMUCKER CO  
VTR \_\_\_\_\_ VENTAS INC  
TSO \_\_\_\_\_ TESORO CORPORATION  
LNG \_\_\_\_\_ CHENIERE ENERGY INC  
JOY \_\_\_\_\_ JOY GLOBAL  
WDAY \_\_\_\_\_ WORKDAY  
URI \_\_\_\_\_ UNITED RENTALS INC  
DECK \_\_\_\_\_ DECKERS OUTDOOR CORP  
SWIR \_\_\_\_\_ SIERRA WIRELESS INC  
FMX \_\_\_\_\_ FOMENTO ECONOMICO MEX  
ADSK \_\_\_\_\_ AUTODESK INC  
LULU \_\_\_\_\_ LULULEMON ATHLTCA INC  
RYAAY \_\_\_\_\_ RYANAIR HLDGS PLC ADS  
GMCR \_\_\_\_\_ GREEN MTN COFFEE ROASTER  
CSIQ \_\_\_\_\_ CANADIAN SOLAR INC  
HES \_\_\_\_\_ HESS CORP  
KSU \_\_\_\_\_ KANSAS CITY SOUTHERN  
WYNN \_\_\_\_\_ WYNN RESORTS LTD  
FSLR \_\_\_\_\_ FIRST SOLAR INC. COMMON STOCK  
CP \_\_\_\_\_ CANADIAN PACIFIC RLWY  
DDD \_\_\_\_\_ 3D SYSTEMS

Alternatively, I can send trading signals via email but it may not be as reliable as using C2MT4Connector.dll.

To: [signal@lists.collective2.com](mailto:signal@lists.collective2.com)

Subject: C2 signal

Text:

systemid=12345

pw=bonzaiBaby231

BTO 100 AAPL LIMIT 12.34 GTC (stock)

profittarget=35

stoploss=9

---

<div class="post-metadata">

**Author:** ![BobSvan2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/bobsvan2/32/21391_2.png) [@BobSvan2](https://forums.collective2.com/u/BobSvan2)\
**Post date:** [June 17, 2015, 5:27pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/7 "2015-06-17T17:27:34Z")

</div>

OK. Done. You can try it as it is now.

If you will not use some obscure symbols 😱 it will work.

No Exchange needed.

Let mi know.

Happy trading!

---

<div class="post-metadata">

**Author:** ![BobSvan2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/bobsvan2/32/21391_2.png) [@BobSvan2](https://forums.collective2.com/u/BobSvan2)\
**Post date:** [August 4, 2015, 2:01pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/8 "2015-08-04T14:01:28Z")

</div>

Hello traders!

We added a “translation file” to support stocks and other instruments signals from MetaTrader to C2.

It is an optional C2MT4Connector.ini file which looks like this:

* * *

```
[C2Symbology]
; ----------------------------------------------------
; Translation from MT4 symbols to Collective2 symbols
; ----------------------------------------------------
;
; Syntax: MT4Symbol = Collective2Symbol
; For example: Ger30Sep15 = XGU5
; 
; Lines starting with semicolon are comments.
;
; You can EXCLUDE some symbols from being posted to Collective2.
; For example: EURCHF = EXCLUDE
; EURCHF signals will NOT be sent to Collective2 then, but trades in MT4 
; will be performed!
;
Ger30Sep15=XGU5

```

* * *

Our C2MT4Connector looks in this file whenever it sends a signal to Collective2.  
If it finds a MetaTrader symbol in this file, it changes it to the Collective2 symbol and sends a signal.  
The symbol used inside MetaTrader is not changed. Just the symbol sent to Collective2.

**Installation:**

- Stop MT4
- Download this file [www.collective2.com/downloads/C2MT4Connector/C2MT4Connector.dll](http://www.collective2.com/downloads/C2MT4Connector/C2MT4Connector.dll)  
to the MQL4\Libraries folder. (Rewrite an old file there. )
- Start Notepad and copy the text from the example above to it.  
(I can’t attach that INI file to this forum.)
- Add your symbols translations there.  
For example add your next months futures symbols and their translations.  
Something like this (just an example!):

Ger30Oct15 = XGV5  
Ger30Nov15 = XGX5

- Save the file as “C2MT4Connector.ini” to the MQL4\Libraries folder too.  
(Check it again - do not make any typo!)

Happy trading!

---

<div class="post-metadata">

**Author:** ![Adrian\_Uncle](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/adrian_uncle/32/238_2.png) [@Adrian\_Uncle](https://forums.collective2.com/u/Adrian_Uncle)\
**Post date:** [August 11, 2015, 5:02pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/9 "2015-08-11T17:02:37Z")

</div>

Bob,

I would like to send these symbols directly to collective2

ES  
NQ  
DX  
YM  
TU  
FV  
TY  
US

Can C2 accept these symbols without their expiration date?

ES – S&P500 emini  
NQ – NASDAQ emini  
DX – US dollar index  
YM – Dow Jones emini  
TU - 2Year US treasury notes  
FV - 5Year US treasury notes  
TY - 1oYear US treasury notes  
US - 30Year US treasury bonds

---

<div class="post-metadata">

**Author:** ![BobSvan2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/bobsvan2/32/21391_2.png) [@BobSvan2](https://forums.collective2.com/u/BobSvan2)\
**Post date:** [August 11, 2015, 5:23pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/10 "2015-08-11T17:23:17Z")

</div>

No. We will not recognize them as futures without a month and a year code.

---

<div class="post-metadata">

**Author:** ![BobSvan2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/bobsvan2/32/21391_2.png) [@BobSvan2](https://forums.collective2.com/u/BobSvan2)\
**Post date:** [September 14, 2016, 7:05pm UTC](https://forums.collective2.com/t/using-mt4-to-send-trading-stock-signals-to-c2/8093/11 "2016-09-14T19:05:32Z")

</div>

Please use symbols with two year digits: XGU15, XGX15 (and so on).  
One year digit (XGU5, XGX5) does not work.
