Same instrument, different broker naming

 
Hi guys! We know that same instrument (particularly indices) can have different names based on different brokers (or platforms). I even tried using ChartSymbol() on different brokers and I realized that the same name on the market watch is still being output by the EA and not a broker/platform independent name. For instance some brokers use NIKK225, US30 and FTSE100 wile some use JP225, WallSt30 and UK100, respectively. How can I make my EA recognize the instrument automatically since I do not have to write an EA for every broker. Or is there a primary key apart from the names for each instrument that we do not know. Thanks.
 
macpee: Hi guys! We know that same instrument (particularly indices) can have different names based on different brokers (or platforms). I even tried using ChartSymbol() on different brokers and I realized that the same name on the market watch is still being output by the EA and not a broker/platform independent name. For instance some brokers use NIKK225, US30 and FTSE100 wile some use JP225, WallSt30 and UK100, respectively. How can I make my EA recognize the instrument automatically since I do not have to write an EA for every broker. Or is there a primary key apart from the names for each instrument that we do not know. Thanks.

You can't, but Instead do this ...

  • If it is a single symbol EA, let the user place it on the correct chart.
  • If it is multi-symbol, then let the user fill in a string input with the names of the symbols.

In both cases, have your EA read the contract specifications of the symbols to adapt to the brokers conditions for those symbols.

 
Fernando Carreiro #:

You can't, but Instead do this ...

  • If it is a single symbol EA, let the user place it on the correct chart.
  • If it is multi-symbol, then let the user fill in a string input with the names of the symbols.

In both cases, have your EA read the contract specifications of the symbols to adapt to the brokers conditions for those symbols.

The second is the case.

In both cases, have your EA read the contract specifications of the symbols to adapt to the brokers conditions for those symbols.

How can I make my EA read the contract specification? This I need to know but let me browse it first and see. Thanks though.

 
macpee #: The second is the case ... How can I make my EA read the contract specification? This I need to know but let me browse it first and see. Thanks though.

The following may be for Market products but it should also be used for personal EAs as well. It includes reading contract specifications.

Articles

The checks a trading robot must pass before publication in the Market

MetaQuotes, 2016.08.01 09:30

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.