Libraries: JSON Serialization and Deserialization (native MQL) - page 9
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1.12
set step 100 in ArrayResize
Do I need to update sources in Codebase?
Dear specialists! Please help me to understand the library. ( I am not good at object-oriented programming yet, so I can't understand the code of the library itself and the article dedicated to the BTC-E exchange. that's why I ask for a simple example as in the post #58 ).
I need to parse two public api of WEX.NZ exchange.
https://wex.nz/api/3/info
from here, I need to get all available pairs (btc_usd, btc_rur, ...) in an array (just pair names, without parameters, I can get parameters by known names...).
https://wex.nz/api/3/depth/btc_usd
and from here get the price and value of orders in two arrays (asks and bids).
I would be very grateful for your help!!! Thanks in advance!
show your code where you left off, what exactly is failing?Do I need to update the sources in Codebase?
Good job, kudos!
However... If you get broken data for deserialisation (the number of opening quotes or brackets is not equal to the number of closing quotes or brackets), the program crashes with a message about array overrun. And this is very bad, such moments must be taken into account when working with arrays, at least if there is no check for correctness of input data.
Good job, kudos!
However... If you get broken data for deserialisation (the number of opening quotes or brackets is not equal to the number of closing quotes or brackets), the program crashes with a message about array overrun. And this is very bad, such moments must be taken into account when working with arrays, at least if there is no check on the correctness of input data.
show your code where you left off, what exactly you are failing atIn general, I can't even figure out how to get the names of all pairs from the first link :-(
---
I get access to the parameters of a pair from the first link in the following way:
where ttt is the string obtained from the web request.
From the second link, I have solved the problem, I get access as follows:
whereX- order number (starting from zero)
Y- 0- is the price, 1- is the value .
Anyway, I can't even figure out how to get the names of all the pairs from the first link :-(
---
I get access to the parameters of a pair from the first link in this way:
where ttt is the string obtained from the web request.
From the second link, I have solved the problem, I get access as follows:
whereX- order number (starting from zero)
Y- 0- is the price, 1- is the value .
and ok.
If it solves your problem now, use this solution.
If it is not enough, you will come up with something better.
Okay.
If it solves your problem now, use it.
If it's not enough, you'll come up with something better.
No, no, no. You misunderstood a little bit...
I've solved everything except one! I need to get all the names of the pairs! I understand how to get the known ones, but how to get the unknown ones?
Demonstrate specific data
2018.02.21 14:03:39.861 jason_test (EURUSD,W1) {"asdasdasdasd":{"sdfs":0.02189746, "dfgdf":0.01925917}}
2018.02.21 14:03:39.861 jason_test (EURUSD,W1) {"asdasdasd":{"sdfs":0.02189746, "dfgdf":0.01925917}}
2018.02.21 14:03:39.861 jason_test (EURUSD,W1) {"asdasdasdasd":{"sdfs":0.02189746, "dfgdf":0.01925917}}
2018.02.21 14:03:39.862 jason_test (EURUSD,W1) array out of range in 'json.mqh' (597,19)