<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Timur Khamatov</title>
    <description>The latest articles on DEV Community by Timur Khamatov (@timur_khamatov_0d0427f649).</description>
    <link>https://dev.to/timur_khamatov_0d0427f649</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4241859%2F645f0e56-695d-4f03-b445-82a827396239.png</url>
      <title>DEV Community: Timur Khamatov</title>
      <link>https://dev.to/timur_khamatov_0d0427f649</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/timur_khamatov_0d0427f649"/>
    <language>en</language>
    <item>
      <title>Check both response layers in a Go MT4/MT5 copier client</title>
      <dc:creator>Timur Khamatov</dc:creator>
      <pubDate>Fri, 04 Dec 2026 03:13:35 +0000</pubDate>
      <link>https://dev.to/timur_khamatov_0d0427f649/check-both-response-layers-in-a-go-mt4mt5-copier-client-n9c</link>
      <guid>https://dev.to/timur_khamatov_0d0427f649/check-both-response-layers-in-a-go-mt4mt5-copier-client-n9c</guid>
      <description>&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I work on MetaRPC, which provides developer APIs, SDKs and hosted software. This article was prepared with AI assistance. The code below was executed against local fixtures; it does not demonstrate a live trade or successful production authentication.&lt;/p&gt;

&lt;p&gt;A read-only request is a useful first step when integrating a trade copier: can the client list the copier records owned by this API key? Before interpreting the result, check the contract of the wrapper you are using.&lt;/p&gt;

&lt;p&gt;In the current &lt;strong&gt;MetaRPC GoCopier&lt;/strong&gt; wrapper, a failed RPC can become a reply with &lt;code&gt;Ok: false&lt;/code&gt; and an &lt;code&gt;Error&lt;/code&gt; string, while the returned Go error is &lt;code&gt;nil&lt;/code&gt;. Checking only &lt;code&gt;err&lt;/code&gt; can therefore send your program down its success path after a refusal or a timeout.&lt;/p&gt;

&lt;p&gt;This behavior belongs to this wrapper. It is not a general rule that generated Go gRPC clients discard transport errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  The check to make
&lt;/h2&gt;

&lt;p&gt;The core sequence is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Handle a Go-level failure.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// There is no usable response.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Ok&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The operation failed, even though err is nil.&lt;/span&gt;
    &lt;span class="c1"&gt;// Inspect reply.Error privately, with appropriate redaction.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Now interpret reply.Copiers. An empty successful list is valid.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid treating an empty list as an authentication error. &lt;code&gt;Ok: true&lt;/code&gt; with zero records can simply mean this owner has no copiers. Conversely, an unsuccessful reply does not become successful because its list happens to be empty.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run six cases without credentials
&lt;/h2&gt;

&lt;p&gt;The complete example is in a &lt;strong&gt;public working revision&lt;/strong&gt;, not a new SDK release. Use the fixed revision below in a new directory so the commands reproduce the tested code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/MetaRPC/GoCopier.git gocopier-response-check
&lt;span class="nb"&gt;cd&lt;/span&gt; gocopier-response-check
git checkout a4d60c06dc57ac46585fe72016b2758a8da4edd6
go &lt;span class="nb"&gt;test&lt;/span&gt; ./...
go run ./examples/list-status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repository requires Go 1.21 or later. These commands use the default offline fixture mode; they do not contact a broker or copier service. Go may download the module dependencies.&lt;/p&gt;

&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;request error: request_failed
nil reply: missing_reply
refused with nil Go error: operation_failed
successful empty list: list_ok total=0 paused=0
successful list: list_ok total=2 paused=1
malformed summary: invalid_summary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two records in the successful fixture are synthetic. The final case checks a nil summary entry so the reporting loop cannot panic on malformed input. The output contains categories and counts, without account IDs, broker servers, API keys or raw remote error messages.&lt;/p&gt;

&lt;p&gt;Read the &lt;a href="https://github.com/MetaRPC/GoCopier/blob/a4d60c06dc57ac46585fe72016b2758a8da4edd6/examples/list-status/main.go" rel="noopener noreferrer"&gt;complete example&lt;/a&gt; and &lt;a href="https://github.com/MetaRPC/GoCopier/blob/a4d60c06dc57ac46585fe72016b2758a8da4edd6/examples/list-status/main_test.go" rel="noopener noreferrer"&gt;tests&lt;/a&gt;. A &lt;a href="https://github.com/MetaRPC/GoCopier/blob/a4d60c06dc57ac46585fe72016b2758a8da4edd6/copier/list_transport_failure_test.go" rel="noopener noreferrer"&gt;separate regression test&lt;/a&gt; injects &lt;code&gt;Unauthenticated&lt;/code&gt;, &lt;code&gt;PermissionDenied&lt;/code&gt;, &lt;code&gt;DeadlineExceeded&lt;/code&gt; and &lt;code&gt;Unavailable&lt;/code&gt; into the actual SDK wrapper and verifies its existing failure-envelope behavior. Those are injected errors, not claims about a live server.&lt;/p&gt;

&lt;h2&gt;
  
  
  An optional read-only live check
&lt;/h2&gt;

&lt;p&gt;After the offline exercise, the same example can make &lt;strong&gt;one List request&lt;/strong&gt; if you explicitly run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go run ./examples/list-status --live
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mode requires your real owner key in &lt;code&gt;MRPC_API_KEY&lt;/code&gt;. Supply it through your normal secret-management workflow. The SDK sends lowercase &lt;code&gt;apikey&lt;/code&gt; gRPC metadata and the request's &lt;code&gt;user_key&lt;/code&gt;; a broker login, copier ID or &lt;code&gt;TRIAL&lt;/code&gt; is not a replacement. The &lt;a href="https://metarpc.github.io/GoCopier/authentication/" rel="noopener noreferrer"&gt;authentication guide&lt;/a&gt; explains the differences between gRPC, REST and WebSocket requests.&lt;/p&gt;

&lt;p&gt;The example uses TLS and a ten-second deadline. It does not create accounts, start or pause copiers, remove records, or place trades. Existing running services continue their normal billing. It is a Go client that can run on Windows, macOS or Linux; it does not install a local MetaTrader terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Success here is only success of the read
&lt;/h2&gt;

&lt;p&gt;These categories are deliberately broad. They prevent a false success path; they do not diagnose the root cause or implement automatic retries. Correct a key or ownership problem before retrying. For operations with side effects, reconcile the actual server state before repeating an uncertain request.&lt;/p&gt;

&lt;p&gt;A successful List also does not prove that copying works. For that, use disposable demo accounts and separately verify sizing, one opening and closing, pause/resume and the relevant logs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://mrpc.pro/start/copier?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=go_reply_check_dec03&amp;amp;utm_content=en_setup" rel="noopener noreferrer"&gt;MT4/MT5 copier setup guide&lt;/a&gt; covers the next steps, and the &lt;a href="https://mrpc.pro/tools/copier-sizing?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=go_reply_check_dec03&amp;amp;utm_content=en_sizing" rel="noopener noreferrer"&gt;lot-sizing worksheet&lt;/a&gt; helps review requested follower volume before a demo test. The worksheet does not establish equal financial risk or place trades. Hosted terminals and running copiers use service credit, including on broker demo accounts.&lt;/p&gt;

&lt;p&gt;MetaRPC supplies APIs and software infrastructure. We do not hold, manage or invest customers' trading funds. This is a software-validation exercise, not investment advice.&lt;/p&gt;

</description>
      <category>go</category>
      <category>grpc</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>MT4 e MT5: confira os símbolos antes de configurar um copiador</title>
      <dc:creator>Timur Khamatov</dc:creator>
      <pubDate>Fri, 04 Dec 2026 02:25:31 +0000</pubDate>
      <link>https://dev.to/timur_khamatov_0d0427f649/mt4-e-mt5-confira-os-simbolos-antes-de-configurar-um-copiador-cco</link>
      <guid>https://dev.to/timur_khamatov_0d0427f649/mt4-e-mt5-confira-os-simbolos-antes-de-configurar-um-copiador-cco</guid>
      <description>&lt;p&gt;&lt;strong&gt;Transparência:&lt;/strong&gt; trabalho na MetaRPC, que fornece APIs, SDKs e software para desenvolvedores. Este exercício compara nomes localmente; não conecta contas, não configura um copiador e não envia ordens. O texto foi preparado com assistência de IA e o exemplo foi executado com os dados abaixo.&lt;/p&gt;

&lt;p&gt;Uma corretora usa &lt;code&gt;EURUSD&lt;/code&gt;; outra usa &lt;code&gt;EURUSD.a&lt;/code&gt;. Basta remover o sufixo? Não: nomes parecidos não comprovam que dois instrumentos tenham o mesmo contrato, moeda ou unidade de lote. E, quando os dois nomes existem no destino, escolher o primeiro resultado esconde uma decisão importante.&lt;/p&gt;

&lt;p&gt;Antes de testar a cópia entre MT4 e MT5, podemos transformar duas listas de símbolos em uma lista de revisão. É uma etapa pequena, reproduzível e independente da linguagem usada na integração final.&lt;/p&gt;

&lt;h2&gt;
  
  
  Um teste local, sem credenciais
&lt;/h2&gt;

&lt;p&gt;O exemplo usa Node.js 20 ou posterior e funciona no Windows, macOS e Linux. Não precisa de instalação de pacotes npm nem de chave de API.&lt;/p&gt;

&lt;p&gt;O código está em uma &lt;strong&gt;revisão pública de trabalho&lt;/strong&gt;, ainda não apresentada como versão publicada do SDK. Para reproduzir exatamente o exemplo, use esta revisão fixa em uma pasta nova:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/MetaRPC/NodeCopier.git nodecopier-symbol-review
&lt;span class="nb"&gt;cd&lt;/span&gt; nodecopier-symbol-review
git checkout 998ed420e5e5c600a3910286899436fd9db99a44
node examples/symbol-preflight.cjs examples/symbols.demo.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Você também pode ler o &lt;a href="https://github.com/MetaRPC/NodeCopier/blob/998ed420e5e5c600a3910286899436fd9db99a44/examples/symbol-preflight.cjs" rel="noopener noreferrer"&gt;código completo nessa revisão&lt;/a&gt; antes de executar qualquer comando.&lt;/p&gt;

&lt;p&gt;O arquivo de demonstração contém:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"master"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"EURUSD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"GBPUSD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"USDJPY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"XAUUSD"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"follower"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"EURUSD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"EURUSD.a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"GBPUSD.a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"USDJPY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"GOLD"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Leia o resultado como uma lista de revisão
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Origem&lt;/th&gt;
&lt;th&gt;Candidatos no destino&lt;/th&gt;
&lt;th&gt;Resultado&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD&lt;/td&gt;
&lt;td&gt;EURUSD, EURUSD.a&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ambiguous&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD&lt;/td&gt;
&lt;td&gt;GBPUSD.a&lt;/td&gt;
&lt;td&gt;&lt;code&gt;review_candidate&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;td&gt;&lt;code&gt;exact_name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD&lt;/td&gt;
&lt;td&gt;nenhum&lt;/td&gt;
&lt;td&gt;&lt;code&gt;no_name_match&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As quatro linhas retornam &lt;code&gt;requiresSpecificationReview: true&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ambíguo:&lt;/strong&gt; o nome exato não elimina o outro candidato. Compare os contratos antes de escolher.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Candidato:&lt;/strong&gt; a semelhança no nome não comprova equivalência. Um prefixo ou sufixo pode indicar condições diferentes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nome exato:&lt;/strong&gt; ainda é necessário conferir o instrumento e suas especificações nas duas corretoras.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sem correspondência:&lt;/strong&gt; o programa não presume que &lt;code&gt;GOLD&lt;/code&gt; seja equivalente a &lt;code&gt;XAUUSD&lt;/code&gt;. Aliases exigem revisão explícita.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;O código de saída zero significa que a análise terminou. Não significa que o mapeamento foi aprovado ou que já é seguro ativar a cópia. O programa não seleciona nem envia um mapeamento.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use suas próprias listas
&lt;/h2&gt;

&lt;p&gt;Exporte os nomes de símbolos das duas corretoras e salve um JSON UTF-8 no mesmo formato. Passe o caminho do novo arquivo no lugar de &lt;code&gt;examples/symbols.demo.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Cada lista aceita de 1 a 250 nomes. O exemplo remove espaços externos e duplicatas idênticas. Para procurar candidatos, compara prefixos e sufixos sem diferenciar maiúsculas de minúsculas. Dados inválidos geram erro; o programa não os descarta silenciosamente.&lt;/p&gt;

&lt;p&gt;Não coloque senhas, chaves de API ou identificadores de contas nesse arquivo. Para essa revisão, bastam os nomes dos instrumentos. O exemplo não consulta especificações em tempo real.&lt;/p&gt;

&lt;h2&gt;
  
  
  O que conferir antes do teste em contas demo
&lt;/h2&gt;

&lt;p&gt;Para cada par de símbolos, confira o instrumento subjacente, o tamanho do contrato, as moedas envolvidas, as unidades de lote, o volume mínimo, máximo e incremento, além das permissões de negociação. A mesma quantidade de lotes pode representar exposições diferentes.&lt;/p&gt;

&lt;p&gt;Depois de revisar as especificações:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure o mapeamento pelo fluxo compatível do painel ou servidor. Este exemplo local não adiciona um método ao SDK.&lt;/li&gt;
&lt;li&gt;Use duas contas demo descartáveis e um volume que respeite os limites do destino.&lt;/li&gt;
&lt;li&gt;Abra uma operação na origem e confira símbolo, volume solicitado e volume aceito na conta seguidora.&lt;/li&gt;
&lt;li&gt;Feche a operação e confira o encerramento e o histórico nas duas contas.&lt;/li&gt;
&lt;li&gt;Teste pausa e retomada separadamente; registre também as rejeições. Conexão bem-sucedida, sozinha, não comprova que a cópia funciona.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Se uma solicitação expirar, confira as ordens e o histórico antes de repetir: um timeout não prova que a corretora rejeitou a ordem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ferramentas e próximos passos
&lt;/h2&gt;

&lt;p&gt;Para revisar listas sem executar código, há um &lt;a href="https://mrpc.pro/tools/symbol-mapping?lang=pt&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=copier_symbol_preflight_dec03&amp;amp;utm_content=pt_symbols" rel="noopener noreferrer"&gt;comparador de símbolos no navegador (interface em inglês)&lt;/a&gt;. Ele ajuda na revisão dos nomes; não substitui a conferência das especificações.&lt;/p&gt;

&lt;p&gt;O &lt;a href="https://mrpc.pro/start/copier?lang=pt&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=copier_symbol_preflight_dec03&amp;amp;utm_content=pt_setup" rel="noopener noreferrer"&gt;guia de configuração do copiador MT4/MT5&lt;/a&gt; reúne os próximos passos. A ferramenta local e o comparador são gratuitos; terminais hospedados e copiadores em execução usam crédito de serviço, inclusive quando conectados a contas demo.&lt;/p&gt;

&lt;p&gt;A MetaRPC fornece software e infraestrutura de APIs. Não investimos nem gerenciamos fundos de clientes. Este artigo trata da validação técnica de uma integração, não de uma recomendação de investimento.&lt;/p&gt;

</description>
      <category>node</category>
      <category>braziliandevs</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>MT4 y MT5: comprueba los símbolos antes de configurar un copiador</title>
      <dc:creator>Timur Khamatov</dc:creator>
      <pubDate>Thu, 03 Dec 2026 17:28:05 +0000</pubDate>
      <link>https://dev.to/timur_khamatov_0d0427f649/mt4-y-mt5-comprueba-los-simbolos-antes-de-configurar-un-copiador-55i3</link>
      <guid>https://dev.to/timur_khamatov_0d0427f649/mt4-y-mt5-comprueba-los-simbolos-antes-de-configurar-un-copiador-55i3</guid>
      <description>&lt;p&gt;Si copias operaciones entre dos brókeres, un símbolo llamado EURUSD en ambos lados no basta para validar la configuración. Puede haber contratos, unidades de lote o permisos distintos. Y si el destino ofrece EURUSD y EURUSD.a, seleccionar automáticamente el primero oculta una decisión importante.&lt;/p&gt;

&lt;p&gt;Trabajo con MetaRPC, que proporciona APIs y software para desarrolladores. Este artículo explica una comprobación local; no es una recomendación de inversión y el ejemplo no conecta cuentas ni envía operaciones.&lt;/p&gt;

&lt;h2&gt;
  
  
  El problema: nombres parecidos no son contratos equivalentes
&lt;/h2&gt;

&lt;p&gt;Imagina estas listas exportadas de dos terminales:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Origen&lt;/th&gt;
&lt;th&gt;Símbolos disponibles en destino&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EURUSD&lt;/td&gt;
&lt;td&gt;EURUSD, EURUSD.a&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GBPUSD&lt;/td&gt;
&lt;td&gt;GBPUSD.a&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;td&gt;USDJPY&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XAUUSD&lt;/td&gt;
&lt;td&gt;GOLD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Hay cuatro situaciones diferentes. EURUSD es ambiguo; GBPUSD tiene un candidato por nombre; USDJPY coincide exactamente, pero todavía requiere revisar sus especificaciones; XAUUSD no tiene una coincidencia de nombre. El programa no debe suponer que GOLD es equivalente a XAUUSD.&lt;/p&gt;

&lt;h2&gt;
  
  
  Una comprobación local con Node.js
&lt;/h2&gt;

&lt;p&gt;Guarda lo siguiente como symbols.cjs y ejecútalo con Node.js 20 o posterior. Funciona en Windows, macOS y Linux. No hace falta npm install ni una clave API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'EURUSD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'GBPUSD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USDJPY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'XAUUSD'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;follower&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'EURUSD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'EURUSD.a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'GBPUSD.a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USDJPY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'GOLD'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;follower&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;endsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'ambiguous'&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'no_name_match'&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'exact_name'&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'review_candidate'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;requiresSpecificationReview&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node symbols.cjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El resultado conserva las cuatro situaciones en lugar de producir un mapa aparentemente listo para usar:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EURUSD: &lt;strong&gt;ambiguous&lt;/strong&gt;, con dos candidatos.&lt;/li&gt;
&lt;li&gt;GBPUSD: &lt;strong&gt;review_candidate&lt;/strong&gt;, con GBPUSD.a.&lt;/li&gt;
&lt;li&gt;USDJPY: &lt;strong&gt;exact_name&lt;/strong&gt;, con USDJPY.&lt;/li&gt;
&lt;li&gt;XAUUSD: &lt;strong&gt;no_name_match&lt;/strong&gt;, sin candidatos.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La coincidencia exacta no elimina la ambigüedad cuando también existe un candidato con sufijo. Todas las filas conservan requiresSpecificationReview: true. Un código de salida cero solo indica que el programa terminó.&lt;/p&gt;

&lt;h2&gt;
  
  
  Para listas exportadas, valida también la entrada
&lt;/h2&gt;

&lt;p&gt;Preparé una &lt;a href="https://github.com/MetaRPC/NodeCopier/tree/998ed420e5e5c600a3910286899436fd9db99a44" rel="noopener noreferrer"&gt;versión completa con archivo JSON y pruebas&lt;/a&gt; en una rama de revisión pública. Todavía no forma parte de una nueva versión publicada del SDK. Esa versión admite hasta 250 nombres por lista, rechaza entradas inválidas y elimina duplicados idénticos. Sus pruebas incluyen ambigüedad, diferencias de mayúsculas, prefijos y ejecución por línea de comandos.&lt;/p&gt;

&lt;p&gt;Desde esa revisión:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node examples/symbol-preflight.cjs examples/symbols.demo.json
node --test tests/symbol-preflight.test.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;El código solo encuentra candidatos por prefijo o sufijo. No interpreta alias comerciales ni descarga especificaciones. Un nombre parecido puede ser un falso positivo, y dos nombres diferentes pueden representar instrumentos relacionados que necesitan revisión manual.&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué revisar antes de la primera operación demo
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Instrumento y contrato:&lt;/strong&gt; confirma el subyacente, tamaño del contrato, moneda de cotización y liquidación, y unidad de lote en ambos brókeres.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volumen:&lt;/strong&gt; compara mínimo, máximo y paso. Copiar el mismo número de lotes no garantiza la misma exposición.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permisos:&lt;/strong&gt; comprueba que el instrumento esté disponible para negociar en la cuenta y sesión previstas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mapeo:&lt;/strong&gt; configura y revisa la correspondencia mediante el flujo admitido por tu servidor o panel. Este script no carga un mapeo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resultado:&lt;/strong&gt; con cuentas demo desechables, abre una operación pequeña, verifica símbolo y volumen en el destino, ciérrala y revisa ambos historiales. Después comprueba pausa, reanudación y registros de rechazo.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Si prefieres comparar las listas en el navegador, tienes el &lt;a href="https://mrpc.pro/tools/symbol-mapping?lang=es&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=copier_symbol_preflight_dec02&amp;amp;utm_content=es_symbols" rel="noopener noreferrer"&gt;comparador gratuito de símbolos&lt;/a&gt;. Para elegir entre panel e integración por código, consulta la &lt;a href="https://mrpc.pro/start/copier?lang=es&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=copier_symbol_preflight_dec02&amp;amp;utm_content=es_setup" rel="noopener noreferrer"&gt;guía de configuración del copiador MT4/MT5&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;MetaRPC no invierte ni gestiona fondos de clientes. Los terminales alojados y los copiadores en funcionamiento pueden generar cargos incluso con cuentas demo del bróker; el ejemplo local de este artículo no solicita esos servicios.&lt;/p&gt;

&lt;p&gt;La idea práctica: utiliza el nombre para encontrar candidatos, y las especificaciones del bróker para decidir. No conviertas una coincidencia de texto en una autorización para operar.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>MT4 and MT5 APIs: a demo acceptance test for any SDK</title>
      <dc:creator>Timur Khamatov</dc:creator>
      <pubDate>Wed, 25 Nov 2026 12:29:39 +0000</pubDate>
      <link>https://dev.to/timur_khamatov_0d0427f649/mt4-and-mt5-apis-a-demo-acceptance-test-for-any-sdk-n10</link>
      <guid>https://dev.to/timur_khamatov_0d0427f649/mt4-and-mt5-apis-a-demo-acceptance-test-for-any-sdk-n10</guid>
      <description>&lt;p&gt;A successful login is only the first assertion in an MT4 or MT5 integration test. It does not prove that your application can read fresh quotes, submit a permitted demo order, reconcile a timeout, or clean up after a failure.&lt;/p&gt;

&lt;p&gt;This checklist works whether your client is written in C#, Python, Go, Java, C++, Rust, Ruby or Node.js. Run it against a disposable demo account before enabling any live-account workflow.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: this guide is published by MetaRPC, which provides developer APIs and software infrastructure. AI assisted its drafting and source review. The checklist is a proposed test procedure, not a claim that every SDK or broker configuration has passed it.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Separate the client runtime from the terminal
&lt;/h2&gt;

&lt;p&gt;Your application runtime and the MetaTrader terminal are separate components. A hosted API can let a client on Windows, macOS or Linux call a remote terminal; the terminal and SDK still have their own supported environments and dependencies. Check the selected SDK's prerequisites rather than assuming every package has identical platform support.&lt;/p&gt;

&lt;p&gt;Record the API environment, SDK version or commit, terminal platform, broker server and demo account identifier. Keep passwords and API keys out of the test report.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Write assertions before sending an order
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Evidence to retain&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;Connect using the documented authentication mechanism&lt;/td&gt;
&lt;td&gt;Expected account identity and a usable session/terminal identifier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Account read&lt;/td&gt;
&lt;td&gt;Request account information&lt;/td&gt;
&lt;td&gt;Currency and balance fields are readable; account is confirmed as demo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Market data&lt;/td&gt;
&lt;td&gt;Select a broker-supported symbol and read a quote&lt;/td&gt;
&lt;td&gt;Symbol matches; quote timestamp is suitable for the test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Order validation&lt;/td&gt;
&lt;td&gt;Read volume minimum, maximum and step&lt;/td&gt;
&lt;td&gt;Proposed size is valid for this symbol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open&lt;/td&gt;
&lt;td&gt;Submit one small demo order&lt;/td&gt;
&lt;td&gt;Broker result plus the resulting order/position identifier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reconciliation&lt;/td&gt;
&lt;td&gt;Query current orders/positions and history&lt;/td&gt;
&lt;td&gt;Actual state agrees with the result, including any partial fill&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Close&lt;/td&gt;
&lt;td&gt;Close only the position created by this test&lt;/td&gt;
&lt;td&gt;No remaining test position; history records the outcome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cleanup&lt;/td&gt;
&lt;td&gt;Disconnect according to the API lifecycle&lt;/td&gt;
&lt;td&gt;Test-owned resources are released; unrelated positions remain untouched&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Market closure, insufficient demo margin and symbol restrictions are test prerequisites or broker outcomes. Record them separately from SDK defects. A successful HTTP response alone is not proof of a successful trade: inspect the documented result and the account state.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Treat a timeout as an unknown result
&lt;/h2&gt;

&lt;p&gt;A request can reach the server even when your client never receives its response. Automatically repeating an order submission can therefore create a duplicate.&lt;/p&gt;

&lt;p&gt;Use this decision sequence as pseudocode, adapting it to the API's documented identifiers and consistency behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;submit one intended demo order
if the result is confirmed:
    reconcile the returned identifier with account state
if the result is rejected:
    record the reason; do not silently change size
if the result is unknown or timed out:
    inspect current orders/positions and relevant history
    match the intended operation using available identifiers
    keep the operation unresolved if evidence is ambiguous
    do not automatically submit a second order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not assume that adding an arbitrary idempotency header makes an endpoint idempotent. Use an idempotency feature only if the service documents it.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Exercise failures without exposing secrets
&lt;/h2&gt;

&lt;p&gt;Test a missing credential, an invalid credential, a disconnected session and an invalid volume separately. Keep logs structured: timestamp, test case, environment, operation, correlation identifier, outcome and sanitized error. Exclude authorization headers, passwords and full connection payloads.&lt;/p&gt;

&lt;p&gt;MT4/MT5 API authentication and the copier service are separate contracts. Use the documentation for the actual endpoint; do not copy a header convention from another product.&lt;/p&gt;

&lt;p&gt;For trade-copying integrations, extend the test with a follower account: verify its actual symbol and volume, then test pause/resume using the documented policy for existing orders. The master closing successfully does not prove that the follower closed.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Choose the matching SDK
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://mrpc.pro/api?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=organic_social&amp;amp;utm_campaign=all_sdk_demo_checklist_20261125&amp;amp;utm_content=sdk_directory" rel="noopener noreferrer"&gt;MetaRPC API and SDK directory&lt;/a&gt; covers MT4, MT5 and trade-copying integrations in all eight languages above. C++/Rust/Ruby MT4 and MT5 packages are currently marked preview in the catalogue; check the repository's current status before choosing a production dependency.&lt;/p&gt;

&lt;p&gt;A useful acceptance report includes the assertions, sanitized evidence and unresolved cases. “Logged in successfully” should be one row of that report, not its conclusion.&lt;/p&gt;

&lt;p&gt;What integration failure would you add to this checklist: stale quotes, a partial fill, a lost response, or a follower that disconnected at the wrong moment?&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>api</category>
      <category>testing</category>
      <category>backend</category>
    </item>
    <item>
      <title>Why a trade copier requests 0.05 lots—and why the broker may reject it</title>
      <dc:creator>Timur Khamatov</dc:creator>
      <pubDate>Tue, 17 Nov 2026 11:58:47 +0000</pubDate>
      <link>https://dev.to/timur_khamatov_0d0427f649/why-a-trade-copier-requests-005-lots-and-why-the-broker-may-reject-it-51d3</link>
      <guid>https://dev.to/timur_khamatov_0d0427f649/why-a-trade-copier-requests-005-lots-and-why-the-broker-may-reject-it-51d3</guid>
      <description>&lt;p&gt;Disclosure: I work on MetaRPC, which provides developer APIs and trade-copying software. The example below is a calculation exercise, not an investment recommendation. It does not connect to a broker or place an order.&lt;/p&gt;

&lt;p&gt;A copier can receive a valid trade, calculate the intended follower volume correctly, and still get a rejection from the follower's broker. That is not necessarily a broken connection. The calculated volume may be outside the instrument's allowed range or volume step.&lt;/p&gt;

&lt;p&gt;Here is a small example you can reproduce without credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the requested volume
&lt;/h2&gt;

&lt;p&gt;Assume both accounts use the same deposit currency and the two instruments have the same contract size. The master balance is 10,000, the follower balance is 5,000, and the master opens 0.10 lots. With a balance multiplier of 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requested follower lots = master lots × follower balance / master balance × multiplier
                        = 0.10 × 5,000 / 10,000 × 1
                        = 0.05
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This calculates volume. It does not establish equal financial risk. Stop distance, price, currency conversion, contract specifications and execution all matter. For a different contract or account currency, resolve those differences before using this simplified formula.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validate before rounding
&lt;/h2&gt;

&lt;p&gt;Suppose the follower instrument accepts a minimum of 0.10 lots. Our 0.05 request is too small. Rounding it up to 0.10 would double the intended volume. A generic rounding function should not silently make that decision.&lt;/p&gt;

&lt;p&gt;This Python example deliberately rejects a volume that needs a policy decision. Use the follower broker's current symbol specifications for the limits; the values in the demo are illustrative.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;decimal&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Decimal&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;follower_lots&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;master_lots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;master_balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;follower_balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                  &lt;span class="n"&gt;multiplier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;minimum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maximum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Pass decimal strings to avoid carrying binary float rounding into lots.&lt;/span&gt;
    &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Decimal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;master_lots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;master_balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;follower_balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;multiplier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;minimum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maximum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_finite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Inputs must be finite and greater than zero"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;lots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;follower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;increment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Minimum exceeds maximum"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;requested&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lots&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;follower&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;factor&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;requested&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Requested {requested} lots is outside [{lower}, {upper}]"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# This example uses a volume grid consisting of multiples of the step.&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;requested&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;increment&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Requested {requested} lots is not a multiple of {increment}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;requested&lt;/span&gt;


&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;follower_lots&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"0.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"10000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"5000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0.01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"100"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0.01"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# 0.05&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changing &lt;code&gt;minimum&lt;/code&gt; to &lt;code&gt;"0.10"&lt;/code&gt; raises an error. Changing the follower balance to &lt;code&gt;"3333"&lt;/code&gt; produces 0.03333 lots, which fails a 0.01 step. Neither case is silently turned into a different position size.&lt;/p&gt;

&lt;p&gt;Your production integration may offer an explicit rounding or minimum-lot policy. If it does, show the requested and adjusted volumes before enabling it, document the policy, and test it on demo accounts. Do not infer a broker's volume grid from the number of decimal places in its prices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep calculation, request and fill separate
&lt;/h2&gt;

&lt;p&gt;For each copied trade, keep three values in your diagnostic record:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The requested follower volume from your sizing rule.&lt;/li&gt;
&lt;li&gt;The submitted volume after any explicitly configured normalization.&lt;/li&gt;
&lt;li&gt;The broker's accepted volume, ticket and response—or its rejection.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Also record the source trade identifier, mapped follower symbol and copier state. Avoid recording API keys or account passwords.&lt;/p&gt;

&lt;p&gt;If an order request times out, read current orders and history before retrying. A timeout does not prove the broker rejected the order; repeating an uncertain request can create a duplicate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the whole lifecycle on demo accounts
&lt;/h2&gt;

&lt;p&gt;First use two demo accounts and the smallest volume that satisfies the follower's specifications. Open a master trade, confirm the follower's symbol and size, close the master trade, and confirm the follower closes too. Then test pause/resume separately and inspect the logs. A successful login alone does not prove copying works.&lt;/p&gt;

&lt;p&gt;If you want to compare sizing rules without writing code, our &lt;a href="https://mrpc.pro/tools/copier-sizing?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=mt5_copier_sizing" rel="noopener noreferrer"&gt;free copier-sizing calculator&lt;/a&gt; shows the calculation inputs and result. The &lt;a href="https://mrpc.pro/start/copier?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=mt5_copier_sizing" rel="noopener noreferrer"&gt;demo setup and troubleshooting guides&lt;/a&gt; cover the next steps. The calculator and tutorials are free; running connected terminals and copiers uses paid service credit.&lt;/p&gt;

&lt;p&gt;For MetaRPC integrations, send the owner key in the &lt;code&gt;ApiKey&lt;/code&gt; header on copier REST requests, including status and log reads. Keep any &lt;code&gt;userKey&lt;/code&gt; or &lt;code&gt;managerKey&lt;/code&gt; parameters required by the endpoint as well; they do not replace the header. Keep those credentials on your server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next: verify the API lifecycle
&lt;/h2&gt;

&lt;p&gt;Use the &lt;a href="https://dev.to/timur_khamatov_0d0427f649/mt4-and-mt5-apis-a-demo-acceptance-test-for-any-sdk-n10"&gt;MT4/MT5 demo acceptance checklist&lt;/a&gt; to record authentication, quotes, order results, timeout reconciliation and cleanup across SDK languages.&lt;/p&gt;

</description>
      <category>python</category>
      <category>testing</category>
    </item>
    <item>
      <title>Your Python app can run on Linux while MetaTrader runs elsewhere</title>
      <dc:creator>Timur Khamatov</dc:creator>
      <pubDate>Thu, 12 Nov 2026 23:20:30 +0000</pubDate>
      <link>https://dev.to/timur_khamatov_0d0427f649/your-python-app-can-run-on-linux-while-metatrader-runs-elsewhere-3jmd</link>
      <guid>https://dev.to/timur_khamatov_0d0427f649/your-python-app-can-run-on-linux-while-metatrader-runs-elsewhere-3jmd</guid>
      <description>&lt;p&gt;I work on MetaRPC. One source of confusion in a Python trading integration is the word “remote.” Moving Python to Linux does not magically make the MetaTrader terminal a Linux application. There are two processes to think about: your application and the terminal it communicates with.&lt;/p&gt;

&lt;p&gt;With a local integration, you maintain a compatible terminal installation and its Python environment. With a hosted API, your application sends network requests to a managed terminal. That terminal still exists, and the broker still decides whether an order is accepted.&lt;/p&gt;

&lt;p&gt;The useful first test is a read, not a trade. Put the API key and demo-account credentials in environment variables, connect, read the account summary, then disconnect in &lt;code&gt;finally&lt;/code&gt;. That checks authentication, broker connectivity and cleanup without introducing an open position.&lt;/p&gt;

&lt;p&gt;The new &lt;a href="https://github.com/MetaRPC/PyMT5/blob/main/examples/read_account.py" rel="noopener noreferrer"&gt;PyMT5 read-only example&lt;/a&gt; follows that lifecycle. Its README lists the required environment variables and installation steps. It uses the Python gRPC SDK; do not copy REST header names into a different transport and assume they mean the same thing. REST requests use the APIKey header, while the SDK handles its authentication metadata.&lt;/p&gt;

&lt;p&gt;After a read succeeds, test one small demo order. Record the returned ticket, inspect the actual position, close it and verify that it is closed. If an order request times out, read orders and history before sending it again. A timeout leaves the outcome uncertain; it does not prove that the broker rejected the order.&lt;/p&gt;

&lt;p&gt;Cost also belongs in the test plan. Hosted connections are paid while in use. Disconnect when finished, verify the terminal state in the portal, and estimate usage from the schedule you actually expect to run. The SDK's cleanup attempt is not proof that a failed network request reached the server.&lt;/p&gt;

&lt;p&gt;There is no universal winner between local and hosted integration. Choose based on who will maintain the terminal, where your application must run, which operations you need and how you will recover from failure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mrpc.pro/guides/local-python-vs-cloud-api?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=developer_guides_nov12&amp;amp;utm_content=python_deployment" rel="noopener noreferrer"&gt;Deployment comparison&lt;/a&gt; · &lt;a href="https://mrpc.pro/tutorials/console/python?lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=developer_guides_nov12&amp;amp;utm_content=python_walkthrough" rel="noopener noreferrer"&gt;Python walkthrough&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>linux</category>
      <category>api</category>
    </item>
  </channel>
</rss>
