• Latest
  • Trending
  • All
  • Market Updates
  • Cryptocurrency
  • Blockchain
  • Investing
  • Commodities
  • Personal Finance
  • Technology
  • Business
  • Real Estate
  • Finance
CCXT Application Server Showcase: access crypto exchanges via MQL5 library from MetaTrader 5 – Other – 3 July 2025

Monitoring multiple crypto exchanges online via MQL5 library for Node.js/CCXT – Other – 5 July 2025

July 5, 2025
Canadian dollar gets a lift as trade deal hopes rekindled

Canada trade minister: Trade talks were succesful, positive and substantial

October 7, 2025
It’s not clear if Carney and Trump will speak again after meeting

It’s not clear if Carney and Trump will speak again after meeting

October 7, 2025
Bitcoin whales stack 60K BTC in a week! – $135K in sight IF…

Bitcoin whales stack 60K BTC in a week! – $135K in sight IF…

October 7, 2025
S&P Launches Digital Markets 50 Crypto Index

S&P Launches Digital Markets 50 Crypto Index

October 7, 2025
Bari Weiss steps onto the CBS News glass cliff of doom

Bari Weiss steps onto the CBS News glass cliff of doom

October 7, 2025
Stocks making the biggest moves premarket: TMQ, AEHR, DLTR

Stocks making the biggest moves premarket: TMQ, AEHR, DLTR

October 7, 2025
Fed Board Governor Bowman calls for September rate cut, and another two by year end

Fed’s Bowman does not comment on monetary policy or economic outlook

October 7, 2025
BGMEA unveils AI-enabled Digital Factory Passport for RMG sector

BGMEA unveils AI-enabled Digital Factory Passport for RMG sector

October 7, 2025
Streamex Stock Jumps on Gold-Backed Stablecoin Launch

Streamex Stock Jumps on Gold-Backed Stablecoin Launch

October 7, 2025
3 Days Left to Lock In Your Exhibitor Spot at TechCrunch Disrupt 2025

TechCrunch Disrupt 2025 exhibit tables are selling out fast and time is running out

October 7, 2025
Lenovo’s Chromebook Duet might be the best $200 laptop you can get

Lenovo’s Chromebook Duet might be the best $200 laptop you can get

October 7, 2025
HFT Trading – MT5: Elevate Your Algorithmic Trading on MetaTrader 5 – Trading Systems – 7 October 2025

HFT Trading – MT5: Elevate Your Algorithmic Trading on MetaTrader 5 – Trading Systems – 7 October 2025

October 7, 2025
Tuesday, October 7, 2025
No Result
View All Result
InvestorNewsToday.com
  • Home
  • Market
  • Business
  • Finance
  • Investing
  • Real Estate
  • Commodities
  • Crypto
  • Blockchain
  • Personal Finance
  • Tech
InvestorNewsToday.com
No Result
View All Result
Home Investing

Monitoring multiple crypto exchanges online via MQL5 library for Node.js/CCXT – Other – 5 July 2025

by Investor News Today
July 5, 2025
in Investing
0
CCXT Application Server Showcase: access crypto exchanges via MQL5 library from MetaTrader 5 – Other – 3 July 2025
491
SHARES
1.4k
VIEWS
Share on FacebookShare on Twitter


CcxtAppServerLib is meant for working with all top-100 crypto exchanges from MQL5 through Node.js and CCXT Utility Server, and it’s evolving step-by-step. Newest beta-version contains optimized caching of alternate “markets” (instrument specs and different buying and selling situations), non-blocking studying of websocket messages, and extra.
One introductory instance of utilizing the library – the script CcxtAppSrvShowcase.mq5 – was posted within the weblog earlier.
As one other instance of customized software growth utilizing the library, we offer a script for parallel monitoring of a number of exchanges for chosen sort of knowledge. This function is applied by subscribing by CCXT on Node.js to particular websocket “watches”, equivalent to watchOrderBook, watchTicker, watchTrades, and many others. For particulars, please, see widespread CCXT documentation and extra superior on CCXT PRO. Because the script is meant to make use of solely public APIs, consumer credentials should not concerned right here, however the library helps them in full diploma.

Right here is crucial elements of the brand new demo-script MultiExchangeWatch.mq5 (it is offered together with the beta-version of the library).

NB: If the script is operating very first time, it’s going to ask to unpack (manually) CCXT Utility Server (extracted as ccxtappsrvbundle.jsc from built-in useful resource), and run Node.js with it.

First, embrace the headers.

#embrace "ccxtjsmtlib.mqh" 
#embrace "ccxtutil.mqh"
#embrace <MQL5Book/Feedback.mqh>

Within the inputs, the Node server setup ought to be accomplished.

enter group "Connection settings"
enter string NodeServer = "http://127.0.0.1:8124";
enter string NodeAuth = ""; 

Subsequent, specify various exchanges you wish to monitor, a ticker, and a kind of the watch. By default, the script watches for order books for BCH/USDT.

To fill in these inputs correctly with most popular values, you must in all probability must output the checklist of supported exchanges and their markets beforehand. It may be seen in one other instance script CcxtAppSrvShowcase.mq5, supplied with the lib.

enter string Exchanges = "ascendex,bitmart,binance"; 
enter string Ticker = "BCH/USDT";
enter string Watch = "watchOrderBook";
enter uint WatchingDuration = 10; 

Then OnStart occasion handler does its job. Inline feedback clarify the method. The imported features, lessons and strategies from the library are highlighted in yellow.

string Change[];

void OnStart()
{
   
   
   
   PrintFormat("CCXT AppSrvLibrary model: %.2f", AppSrvLibraryVersion());
   const static string standing[] = {"Cannot deploy",
      "App server ZIP is deployed, however not extracted",
      "App server information are deployed"};
   const int d = DeployCcxtAppServer();
   Print(standing[d + 1]);
   if(d <= 0)
   {
      return; 
   }
   
   
   
   
   SetNodeServer(NodeServer, NodeAuth);

   CcxtLink *hyperlink = GetLink();
   
   
   

   
   
   AutoPtr<CcxtJsExchangeProIntf> ccxt[];
   const int n = StringSplit(Exchanges, ',', Change);
   ArrayResize(ccxt, n);
   
   for(int i = 0; i < n; i++)
   {
      ccxt[i] = CreateExchangePro(Change[i]); 

      if(hyperlink.getLastHttpCode() != 200 || !ccxt[i][] || ccxt[i][][].t >= JS_NULL)
      {
         Print("Development failed for alternate: ", Change[i]);
         return;
      }
      
      const bool isPro = !!*ccxt[i][]["pro"]; 
      
      if(!isPro)
      {
         PrintFormat("WARNING! %s is not PRO, there is no such thing as a websocket assist", Change[i]);
      }
      
      if(!ccxt[i][]["has"][Watch].get<bool>())
      {
         PrintFormat("WARNING! %s doesn't assist '%s' subscriptions", Change[i], Watch);
      }
   }
   
   
   
   int energetic = 0;
   
   for(int i = 0; i < n; i++)
   {
      
      if(ccxt[i][].improve())
      {
         if(!ccxt[i][].watchAnything(StringFormat("%s("%s")", Watch, Ticker)))
         {
            PrintFormat("Cannot begin %s for %s", Watch, Change[i]);
            ccxt[i][].shut(); 
            ccxt[i] = NULL;
         }
         else
         {
            energetic++;
         }
      }
      else
      {
         if(ccxt[i][].isConnected())
         {
            Print("Cannot improve to websockets");
            string headers[][2];
            if(ccxt[i][].ws().getHeaders(headers))
            {
               
            }
            ccxt[i][].ws().shut(); 
            ccxt[i][].shut();
            ccxt[i] = NULL;
         }
      }
   }
   
   if(!energetic) return;

   
   PrintFormat("* Monitoring %d subscriptions", energetic);

   const uint begin = GetTickCount();
   whereas(!IsStopped() && (!WatchingDuration || GetTickCount() - begin < WatchingDuration * 1000))
   {
      for(int i = 0; i < n; i++)
      {
         if(ccxt[i][] && ccxt[i][].isConnected())
         {
            AutoPtr<JsValue> j = ccxt[i][].readMessage(false); 
            if(j[])
            {
               ChronoComment(j[].stringify(0, 0)); 
            }
         }
      }
   }
  
   Print("* Unsubscribing...");
   for(int i = 0; i < n; i++)
   {
      if(ccxt[i][] && ccxt[i][].isConnected())
      {
         ccxt[i][].un().watchAnything(StringFormat("%s("%s")", Watch, Ticker));
      }
   }
   
   
   GracefullClose(ccxt); // not introduced right here within the weblog

   
   
   GracefullClose(ccxt, 5, true);
   
   Remark("");
}

When the script is operating, the checklist of incoming order books (json-messages) is outputted and actively up to date on the chart.

CCXT multiple watches on different crypto exchanges in MetaTrader 5

On high of such a dataflow it is easy to implement varied arbitrage methods and calculate mixed statistics.



Source link

Tags: cryptoExchangesJulylibraryMonitoringMQL5multipleNode.jsCCXTOnline
Share196Tweet123
Previous Post

A better way to solve the cash Isa problem? Close the advice gap

Next Post

French B2B fintech Qonto reaches 600,000 customers, files for banking license

Investor News Today

Investor News Today

Next Post
French B2B fintech Qonto reaches 600,000 customers, files for banking license

French B2B fintech Qonto reaches 600,000 customers, files for banking license

  • Trending
  • Comments
  • Latest
Private equity groups prepare to offload Ensemble Health for up to $12bn

Private equity groups prepare to offload Ensemble Health for up to $12bn

May 16, 2025
The human harbor: Navigating identity and meaning in the AI age

The human harbor: Navigating identity and meaning in the AI age

July 14, 2025
Equinor scales back renewables push 7 years after ditching ‘oil’ from its name

Equinor scales back renewables push 7 years after ditching ‘oil’ from its name

February 5, 2025
Niels Troost has a staggering story to tell about how he got sanctioned

Niels Troost has a staggering story to tell about how he got sanctioned

December 14, 2024
Why America’s economy is soaring ahead of its rivals

Why America’s economy is soaring ahead of its rivals

0
Dollar climbs after Donald Trump’s Brics tariff threat and French political woes

Dollar climbs after Donald Trump’s Brics tariff threat and French political woes

0
Nato chief Mark Rutte’s warning to Trump

Nato chief Mark Rutte’s warning to Trump

0
Top Federal Reserve official warns progress on taming US inflation ‘may be stalling’

Top Federal Reserve official warns progress on taming US inflation ‘may be stalling’

0
Canadian dollar gets a lift as trade deal hopes rekindled

Canada trade minister: Trade talks were succesful, positive and substantial

October 7, 2025
It’s not clear if Carney and Trump will speak again after meeting

It’s not clear if Carney and Trump will speak again after meeting

October 7, 2025
Bitcoin whales stack 60K BTC in a week! – $135K in sight IF…

Bitcoin whales stack 60K BTC in a week! – $135K in sight IF…

October 7, 2025
S&P Launches Digital Markets 50 Crypto Index

S&P Launches Digital Markets 50 Crypto Index

October 7, 2025

Live Prices

© 2024 Investor News Today

No Result
View All Result
  • Home
  • Market
  • Business
  • Finance
  • Investing
  • Real Estate
  • Commodities
  • Crypto
  • Blockchain
  • Personal Finance
  • Tech

© 2024 Investor News Today