- Retrieve values of prices from an indicator
- Specifications of a symbol
- Using Array Values outside of a WebRequest Function
Hello you can use the search function to discover there are 11 pages about JSON subject.
https://www.mql5.com/en/search#!keyword=json&module=mql5_module_forum
- www.mql5.com
Pardon me, Marco. I pasted the code. But wasn't familiar with the interface.
I've updated the post with the code.
peterbabs:
Thank you for the link, Marco vd Heijden!
But I'm not getting the desired result
Print result for CurrencyPair returns blank
Print result for ShortPercentage returns 0
I've not been able to figure it out.
What do you think I'm doing wrong.
string CurrencyPair0=json["symbols"][0]["name"].ToStr(); int ShortPercentage0=json["symbols"][0]["shortPercentage"].ToInt();
As per your json in the first post, you need to point "symbols" array first, then get their items, and since percentage is an integer, you may call ToInt() instead of ToDbl(), something like this:
Thanks, Mohammad!
You have solve a problem for me that has taken me 2weeks...
I'm grateful!!!!!!!!
Thanks, Mohammad!
You have solve a problem for me that has taken me 2weeks...
I'm grateful!!!!!!!!
You're welcome.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use