• 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

CCXT Application Server Showcase: access crypto exchanges via MQL5 library from MetaTrader 5 – Other – 3 July 2025

July 4, 2025
Solana earns $2.85B as ETFs, treasuries boost institutional demand

Solana earns $2.85B as ETFs, treasuries boost institutional demand

October 7, 2025
Best early Amazon Prime Day laptop deals 2025: My 30 favorites sales ahead of October

Best Amazon Prime Day laptop deals 2025: My 34 favorites sales live now

October 7, 2025
ORCL, FIG, TMQ, F and more

ORCL, FIG, TMQ, F and more

October 7, 2025
Best Amazon Prime Day TV deals in October 2025: Save up to $1,600 on LG, Samsung, and more

Best Amazon Prime Day TV deals in October 2025: Save up to $1,600 on LG, Samsung, and more

October 7, 2025
Soft Manager – Trading Ideas – 5 August 2025

Claude vs GPT-5 vs Gemini: Live Gold Trading Experiment Week 1 – My Trading – 7 October 2025

October 7, 2025
Tesla Stock Is Sliding Tuesday Afternoon: What’s Going On? – Tesla (NASDAQ:TSLA)

Tesla Stock Is Sliding Tuesday Afternoon: What’s Going On? – Tesla (NASDAQ:TSLA)

October 7, 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
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

CCXT Application Server Showcase: access crypto exchanges via MQL5 library from MetaTrader 5 – Other – 3 July 2025

by Investor News Today
July 4, 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


CCXT is a JavaScript library for working with all top-100 crypto exchanges. For additional particulars on CCXT, please, go to frequent CCXT documentation and extra superior CCXT PRO.
CcxtAppServerLib is a MQL5 library for working with the crypto exchanges through Node.js and CCXT Utility Server constructed on prime of CCXT.

Newest beta-version of CcxtAppServer library contains optimized caching of alternate “markets” (instrument specs and different buying and selling situations), much less reminiscence footprint throughout parsing of big json-files, higher error dealing with, and new examples.

This blogpost will current an introductory showcase with most necessary capabilities from public APIs – the script CcxtAppSrvShowcase.mq5.

First, embody the headers.

#embody "ccxtjsmtlib.mqh" 
#embody "ccxtutil.mqh"

Within the inputs, the Node server setup needs to be carried out (by default, it is localhost and port 8124).

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

Subsequent, present a selected alternate you wish to work with. Depart the enter empty to view a printout with an inventory of all supported exchanges.

enter string Change = ""; 

Additionally present a ticker you are fascinated with. If you do not know the identify, run the script first time and have a look at MQL5/Information/CCXT/ folder the place all obtained information is dumped by default, so you’ll find json-files with full markets data.

enter string Ticker = "BCH/USDT";

For watching assessments (subscriptions through websockets) specify their period:

enter uint WatchingDuration = 10; 

The script demonstrates how you can setup credentials for personal APIs, however won’t use any non-public operate.

enter group "Change settings (Personal API)"
enter string ApiKey = "";
enter string Secret = "";
enter string Uid = "";
enter string Login = "";
enter string Password = "";

Further settings permit you to management the logging degree, dumping of all obtained information, and timeouts.

enter group "Auxiliary settings"
enter ushort Logging = 1; 
enter bool Dumping = true;
enter uint Timeout = 5; 

Then the primary occasion handler OnStart comes into play. The imported capabilities, courses and strategies from the library are highlighted in yellow. Some elements are omitted for brevity (for particulars have a look at the total supply code, distributed with the library).

Inline feedback are self-explanatory, I feel.

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

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

   
   
   
   SetNodeServer(NodeServer, NodeAuth);

   CcxtLink::Settings settings = {Logging, Dumping, Testing, Timeout, 0};
   CcxtLink *hyperlink = GetLink();  
   hyperlink.applySettings(settings);
   
   
   if(!StringLen(Change))
   {
      Print("Full checklist of exchanges:");
      Print(ListExchanges().stringify());
      Print("Professional checklist of exchanges with websockets help:");
      Print(ListExchanges(true).stringify());

      Print("App Server Model: ", AppSrvVersion().stringify());
      Print("CCXT lib model: ", CcxtVersion()["version"].stringify());
      return;
   }

   
   
   
   CCXT::Credentials credentials = {ApiKey, Secret, Uid, Login, Password};
   
   
   CcxtJsExchangeProIntf *ccxt = CreateExchangePro(Change, credentials, false);
   AutoPtr<CcxtJsExchangeProIntf> auto(ccxt);
   
   
   
   
   
   if(hyperlink.getLastHttpCode() != 200) 
   {
      return;
   }

   
   const bool isPro = !!*ccxt["pro"];
   if(ShowExchangeProperties)
   {
      Print("Is professional: ", isPro);
      Print("Required Credentials:");
      ccxt["requiredCredentials"].print();
      Print("Supported options:");         
      ccxt["has"].print();
      AutoPtr<JsValue> f = ccxt.get("amenities"); 
      Print("Amenities: ", f[].stringify());
   }

   

   
   
   
   AutoPtr<JsValue> examine = ccxt.get();
   if(Dumping) DumpJsonToFile("CCXT/check-" + Change, examine[]);
   
   
   
   
   
   if(ccxt.name("now").t != JS_PRIMITIVE)
   {
      ccxt.loadMarkets(false , false );
      JsValue *data = ccxt.get("markets"); 
      if(Dumping) DumpJsonToFile("CCXT/onlymarkets-" + Change, data);

      
      
      
      
      
      
   }
   else
   {
      Print("Markets are already loaded on Node");
   }

   

   
   
   

   JsValue *orderbook = ccxt.fetchOrderBook(Ticker, 10);
   if(Dumping) DumpJsonToFile("CCXT/orderbook-" + Change + "-" + Escape(Ticker), orderbook);
   
   JsValue *ticker = ccxt.fetchTicker(Ticker);
   if(Dumping) DumpJsonToFile("CCXT/ticker-" + Change + "-" + Escape(Ticker), ticker);
   
   JsValue *ohlcv = ccxt.fetchOHLCV(Ticker, "1m", t ? t - 1000 * 60 * 10 : 0, 10);
   if(Dumping) DumpJsonToFile("CCXT/ohlcv-" + Change + "-" + Escape(Ticker), ohlcv);

   JsValue *trades = ccxt.fetchTrades(Ticker, t ? t - 10000 : 0, 10);
   if(Dumping) DumpJsonToFile("CCXT/trades-" + Change + "-" + Escape(Ticker), trades);
   
   if(!!*ccxt["has"]["fetchBidsAsks"]) 
   {
      string array[] = {Ticker};
      JsValue *bidsasks = ccxt.fetchBidsAsks(array);
      if(Dumping) DumpJsonToFile("CCXT/bidsasks-" + Change + "-" + Escape(Ticker), bidsasks);
   }

   
   
   
   ccxt.fetchAnything(NULL);
   ...

The requested URLs and corresponding names of saved recordsdata are proven within the log.

And now goes the CCXT PRO half based mostly on websockets and stay notification subscriptions.

   
  
   
   if(isPro && ccxt.improve())
   {
      
      ccxt.watchOrderBook(Ticker);
      ccxt.watchTrades(Ticker);
      string tickers[] = {Ticker};
      ccxt.watchBidsAsks(tickers);
      ccxt.watchTrades(Ticker); 
      const uint begin = GetTickCount();
      whereas(!IsStopped() && ccxt.isConnected() && (!WatchingDuration || GetTickCount() - begin < WatchingDuration * 1000))
      {
         AutoPtr<JsValue> j = ccxt.readMessage(); 
         if(j[])
         {
            Remark(j[].stringify()); 
         }
         else
         {
            
         }
      }
   }
   else
   {
      if(isPro && ccxt.isConnected())
      {
         Print("Cannot improve to websockets");
         string headers[][2];
         if(ccxt.ws().getHeaders(headers))
         {
            
         }
         ccxt.ws().shut(); 
      }
   }

   
   if(ccxt.isConnected())
   {
      Print("Unsubscribing...");
      
      ccxt.un().watchOrderBook(Ticker);
      ccxt.un().watchTrades(Ticker);
      ccxt.un().watchBidsAsks(); 
      ccxt.un().watchTrades(Ticker); 

      const uint begin = GetTickCount(); 
      whereas(!IsStopped() && ccxt.isConnected() && (GetTickCount() - begin < 5 * 1000))
      {
         Print("studying...");
         AutoPtr<JsValue> j = ccxt.readMessage();
         if(j[])
         {
            Remark(j[].stringify());
         }
         else
         {
            break;
         }
      }
      
      Print("Closing...");
      
      ccxt.shut();
      
      whereas(!IsStopped()) 
      {
         AutoPtr<JsValue> j = ccxt.readMessage();
         if(j[])
         {
            Remark(j[].stringify());
         }
         else
         {
            break;
         }
      }
   }
}

When the script is operating, all incoming websocket information is proven as feedback on the chart (although the data can replace in a short time).

Watching a crypto-exchange via CCXT Application Server Library

The CCXT Utility Server Library is at the moment in beta-stage and obtainable for testing upon request.



Source link

Tags: accessapplicationCCXTcryptoExchangesJulylibraryMetaTraderMQL5ServerShowcase
Share196Tweet123
Previous Post

Savers should be able to tap private assets through Isas, says IA chief

Next Post

Stripe’s first employee, the founder of fintech Increase, sort of bought a bank

Investor News Today

Investor News Today

Next Post
Stripe’s first employee, the founder of fintech Increase, sort of bought a bank

Stripe’s first employee, the founder of fintech Increase, sort of bought a bank

  • 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
Solana earns $2.85B as ETFs, treasuries boost institutional demand

Solana earns $2.85B as ETFs, treasuries boost institutional demand

October 7, 2025
Best early Amazon Prime Day laptop deals 2025: My 30 favorites sales ahead of October

Best Amazon Prime Day laptop deals 2025: My 34 favorites sales live now

October 7, 2025
ORCL, FIG, TMQ, F and more

ORCL, FIG, TMQ, F and more

October 7, 2025
Best Amazon Prime Day TV deals in October 2025: Save up to $1,600 on LG, Samsung, and more

Best Amazon Prime Day TV deals in October 2025: Save up to $1,600 on LG, Samsung, and more

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