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
This library causes ERROR and i confirmed it
my code
Any idea how to fix it?
It only causes when i desearilize any string
If the string value does contain ';' character then Deserialize fails!
If the string value does contain ';' character then Deserialize fails!
Everything works. I found issue on my side.
Than you . I am sending POST WebRequests (http) from MT5 (MQL5) to Chat GPT-4-o-mini API (openai.com) . OpenAI receives JSON data . MQL does not support JSON . So had to covert to string, then convert string to Char[] array, to insert as postData into the WebRequest . I am using your Library, I'll let you know how I get on
That is awesome
I was thinking the same to feed my ML with response from ChatGPT.
Mind sharing how do you did it? What are the challenges?
Thanks!
Hi, is there any way to:
- Set the value of a key to null
- Set the value of a key to {} (empty object)
It seems that those values won't get correctly represented if you try to set them.
Thanks for any reply
What am I doing wrong?
A real example from practice. A string 21+ thousand characters long. Several variables and 2 large arrays b and a. There are 500 subarrays of 2 elements in each:
I found a discrepancy between the original data and what JASON outputs:
the first 2 lines output the end of the original string, which is parsed by JASON.
When parsing, all elements are written to the array. It gets n=2000 elements. This is correct.
Then 2 lines are the first 20 elements of the array and 2 more lines of the last 20 elements.
At the beginning of the array everything coincides.
But at the end the first digit of the pairs coincides, but the second one does not. Apparently it was taken from somewhere else.
I checked. The second array a contains data from the first array b. Here's the end of the original data from array a:
I.e. the second array in subarrays in the first elements contains its /right value, in the second elements - values from the first array.
The problem is probably in the parser code.
Data substitution is very stressful - how to test on them later? Only incorrectly! Lucky you noticed it. Hopefully for simpler variants without nested arrays it works correctly. But you should test everything before putting it to work.
The code is based on the examples from the branch, only with my data string:
The full code of the script with this string is attached.
Library of the latest version "1.13" - downloaded from GitHub.
Above also write about problems with the second element. Probably the same problem.
I made myself a data parsing for a particular template, through the split by quotes " with the subsequent selection of elements by number.
Minus - for each template will have to spend time and write their own parser and count the numbers of elements ...
Plus - 3 times faster universal and convenient JASON. Instead of 40 seconds 13 on the initial data ~400 Mb.
Spent half a day on it.
More precisely on 3 versions:
1) first I searched for specific substrings in char array and then assembled strings from their values - I assumed that this would be the fastest code
I wanted to work directly with char array, because I have the original one from WebRequest or FileOpen and didn't want to assemble it into a large string for speed.
2) then from char[] I created strings only with arrays b and a - and split
3) and finally the simplest code - each string was collected into one big text string (with all data including unnecessary ones) and split it
It turned out that all 3 variants are about the same in speed. That's why I decided on the simplest - the 3rd variant. It will be easier to modify it later to other templates with other data.
For some reason I thought that working with char array will be faster than assembling it into a string and splitting it into a string array via ". Apparently split is well optimised for speed.
It would be good if MQ developers added some of the standard JSON parsers to the language. JASON does not parse all variants correctly and apparently the developer is no longer here and there is no hope for a fix.Library of the latest version "1.13" - downloaded from GitHub
There is a rewritten fork of the code from this topik (1.12). Have you checked with the original?
PS: I have 1.12 original and heavily corrected. I don't remember where the corrections came from, probably from this branch.