- Welcome to algorithmic trading
- Deposits and withdrawals - Getting Started
- Working with Storage - Projects and MQL5 Storage
Hi please post the MQ4/5 files.
I do not attach the code because it is not my problem,I am convinced that my code does not fail. it is an error in the function and it affects all the users, besides I have it with my api key and 4 includes files and I do not want to complicate it.
the idea is that it reaches the language developers, but I can not present a ticket and I have deleted the one that presents.
If the developers understand and do the tests, they will understand the error and they will fix it, not for me, for everyone.
You as moderator should suggest that you read this message, thank you
And here we are...
And here we are...
I do not understand how this can help, but if what you want is the code, here it is.
I hope then that with your tests, please, please, at least comment whether I am wrong or not, that there is a problem
It is the same code in MQL4 and in MQL5
#include <SHA256.mqh> //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- Print ("Start of tests -> send order to binance"); char resultado[],data[]; string headersResp; string PreConsulta; string METODO; string Firma=""; string headersCons=""; METODO="POST"; PreConsulta="api/v3/order"; string Consulta; Consulta="symbol="+"ZILBTC"+"&side="+"BUY"+"&type=MARKET"+"&quantity="+"500"+"&newOrderRespType=FULL"+"&newClientOrderId="+"abc123"; Consulta=Consulta+"×tamp="+CHECKTIME()+"&recvWindow=10000"; //****Obtencion de el Hash****** SHA256 hash256; string keystr="YOUR SECRET KEY HERE"; string msgstr= Consulta; string resultadoSHA=hash256.hmac(msgstr,keystr); //Print("Hash: "+hash.Str()); // **** FIN OBTENCION HASH*** Firma="&signature="+resultadoSHA; headersCons="X-MBX-APIKEY: "+"YOUR API KEY HERE"; string LineaFinal="https://api.binance.com/"+PreConsulta+"?"+Consulta+Firma; //Print(LineaFinal); int res=WebRequest(METODO,LineaFinal,headersCons,10000,data,resultado,headersResp); string Resf=CharArrayToString(resultado); /*int handle=FileOpen("MasMiguelllllle.txt",FILE_TXT|FILE_WRITE|FILE_READ); if(handle>0) { FileWrite(handle,Resf); FileClose(handle); } */ Print("CodeResponse: ",res," - Size String response: ",StringLen(Resf)," - Response of Binance: ",Resf); Print ("End Test"); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ string CHECKTIME() { char resultado[],data[]; string headersResp; string METODO="GET"; string Firma=""; string headersCons=""; int res=WebRequest(METODO,"https://api.binance.com/api/v1/time",headersCons,10000,data,resultado,headersResp); string Resf=CharArrayToString(resultado); return StringSubstr(Resf,14,13); } //+------------------------------------------------------------------+
I don't use MQ4/5 for web-requests. I am using powershell and wget to load and parse the files - it can be easily organized by Windows' event scheduler and then I just load a csv.-file by mq4/5.
This way I am using 'spacialists' for that!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use