How to show BTCUSD from Bittrex on MT5? - page 2

 
Lorentzos Roussos:
Here is a collection of functions for MT4  , for the Binance API .It can be improved with JSON library though.

Thank you for the answer. I am looking at your help and I am glad to I received answers this time. Grateful heartiest one... :)

 

Thank you Fernando sir. And my apologize if I offended. But trust me sir I have searched many references but they were of no use to me. Otherwise I wouldn't have troubled at all.

 
quasireality:

Hi Jaffer,


It's possible your broker doesn't deliver crypto-currencies. 

See where it says: "Click to add" - type in "BTC" there


If nothing comes up, your broker doesn't offer Bitcoin on their MT5 server. 

Yeah I tried. I am working with the MT5 demo currently. Have not tried any broker yet.

 

jaffer wilson: Thank you Fernando sir. And my apologize if I offended. But trust me sir I have searched many references but they were of no use to me. Otherwise I wouldn't have troubled at all.

jaffer wilsonYeah I tried. I am working with the MT5 demo currently. Have not tried any broker yet.

Well then ... you have just proven my point for both of my posts (#1 and #4).

 
Fernando Carreiro:

Well then ... you have just proven my point for both of my posts (#1 and #4).

Sir, I won't to speaking to you anymore. Because speaking anything to you is a waste of time and energy. I try to be nice to you all the time expect where you offended me and hurt me with your words. 

Secondly, you try to pull me down even if there is no scenario where I am trying to pull you down or disrespect you apart from the time when you disrespected me.

Well, thank you anyways.

 
jaffer wilson:

Hello everyone,

Please guide me how I can get the BTCUSD pair on the MT5 using Custom Symbol or anything else apart from the Market place of MT5. I am looking for some custom solution so I can display any pairs in future on MT5 charts.

Please do answer and enlighten me.

Here is an example of a script that downloads an array Close[] directly from the exchange Bittrex.com and displays the price chart on the screen.

Just do not forget to add the site https://bittrex.com to the list of allowed for WebRequest.


#include <Crypto\Bittrex.mqh>
#include <Canvas\iCanvas.mqh>   // https://www.mql5.com/ru/code/22164

void OnStart()
  {
   ChartSetInteger(0,CHART_SHOW,false); ChartChanged();
   
   ulong t0=GetMicrosecondCount();
   CBittrex Bittrex("USD-BTC");
   t0=GetMicrosecondCount()-t0;
  
   ulong t=GetMicrosecondCount();
   double PrMin1=ChartGetDouble(0,CHART_PRICE_MIN);
   double PrMax1=ChartGetDouble(0,CHART_PRICE_MAX);
   double PrMax2=Bittrex.Close[ArrayMaximum(Bittrex.Close,0,W.BarsInWind)];
   double PrMin2=Bittrex.Close[ArrayMinimum(Bittrex.Close,0,W.BarsInWind)];
   Canvas.Erase(ColorToARGB(clrLavender));
   Canvas.Comm("SYMBOL = "+Bittrex.PairName);
   Canvas.Comm("Total Bars = "+(string)Bittrex.N);
   Canvas.Comm("Maximum Price = "+DoubleToString(PrMax2,2));
   Canvas.Comm("Minimum Price = "+DoubleToString(PrMin2,2));  
   Canvas.TextPosition(W.Width-48,25); // coordinates of the beginning of the text message in pixels.
   Canvas.CurentFont("Arial",13,30,ColorToARGB(clrDarkViolet)); // 30 - line spacing
   for(int i=30;i<(W.Height-5);i+=30)
     {
      Canvas.LineHorizontal(W.Width-1,W.Width-6,i,ColorToARGB(clrDarkViolet));
      Canvas.Comm(DoubleToString(PrMax2-i*(PrMax2-PrMin2)/W.Height,2));
     }
   int cl[];
   ArrayResize(cl,Bittrex.N);
   for(int i=0;i<Bittrex.N;i++) cl[i]=(int)round(Canvas.Y(PrMin1+(PrMax1-PrMin1)*(Bittrex.Close[i]-PrMin2)/(PrMax2-PrMin2)));
   for(int i=1;i<Bittrex.N;i++) Canvas.LineWu((int)Canvas.X(double(i-1)),cl[i-1],(int)Canvas.X(double(i)),cl[i],ColorToARGB(clrBlue));
   Canvas.Update();
   t=GetMicrosecondCount()-t;
   
   Canvas.TextPosition(30.0,10.0); // coordinates of the beginning of a text message in % of the window size.
   Canvas.CurentFont("Times New Roman",30,35);  // 35 - line spacing
   Canvas.Comm("Screen formation time = "+DoubleToString(t/1000.0,2)+" milliseconds");
   Canvas.Comm("Time to download data from the Bittrex = "+DoubleToString(t0/1000.0,2)+" milliseconds");
   Canvas.Update();

   Sleep(30000);
   ChartSetInteger(0,CHART_SHOW,true);
  }



Files:
Bittrex.mqh  10 kb
Bittrex.mq5  3 kb
 
Nikolai Semko:

Here is an example of a script that downloads an array Close[] directly from the exchange Bittrex.com and displays the price chart on the screen.

Just do not forget to add the site https://bittrex.com to the list of allowed for WebRequest.




Thank you sir. I will try it out

 

Yes, it is interesting - 


 
Sergey Golubev:

Yes, it is interesting - 


Yes moderator sir. I also like this one. trying to attempt to make it like an indicator or expert instead of script so as to get live data feed this time. It helped me a lot.

 

By the way, why Bittrex?
You can select the brokers proposing cryptocurrencies - I just found two (you can find more):