And I tried it's examples code with some different API's. but i don't know how to use JSON Header. Can some one please help me? And As there is very very less content is there on internet about api request in mql, It will not help me only but other peoples too.
HTTP, HTML, XML, JSON, and others, are all protocols not related to MQL coding. For those you will find plenty of information elsewhere on the internet (see below), not necessarily here.
There are however some implementations of JSON parsing in the CodeBase and in Articles which you could study as a reference.
Forum on trading, automated trading systems and testing trading strategies
Fernando Carreiro, 2016.09.02 00:18
You will have to collect that data from Websites that are offering those services (be they paid or free). You can use the function WebRequest() to obtain data from the web, but you will have to learn about HTTP, and depending on the API the website provides, you may also need to learn REST, JSON or XML or even standard HTML. These web protocols are however beyond the scope of this forum, so for more information you will have to search the Internet. Here are some links to get you started:
- https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
- https://www.w3.org/Protocols/
- http://www.json.org/
- http://www.w3schools.com/json/
- http://www.w3schools.com/xml/
- http://www.w3schools.com/html/
Please note, that collecting and parsing Web data via an API, is not something for a beginner or newbie coder. It requires at least an intermediate level of coding knowledge and good understanding about web protocols.
I also suggest reading the following threads on here:
EDIT: There are also relevant entries in the Codebase that will be of interest to you (had you done a search):
- Retrieve high impact events from ForexFactory.com and display them in your indicator or Expert Advisor
- FFC - Forex Factory Calendar
NB! However, please note that WebRequest() only works in EA's and Scripts but not in Indicators.
Forum on trading, automated trading systems and testing trading strategies
How can i send cookie session from WebRequest?
Fernando Carreiro, 2016.06.06 00:31
Maybe you should first learn about the HTTP protocol and how it all works. The cookie session (or any other header) can be transferred back and forth via the "headers" and "result_headers" arguments/parameters:
You will have to parse "result_headers" in accordance with the HTTP Headers format in order to extract the cookie information (or other header information you may need). Then when submitting a new request you will have to build the "headers" parameter according to the HTTP rules.
Here are some helpful links to get you started:
- https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
- https://en.wikipedia.org/wiki/HTTP_cookie
- https://www.w3.org/Protocols/
- https://www.nczonline.net/blog/2009/05/05/http-cookies-explained/
Please, note that this is not really a MQL coding related issue and you should look for advice and help about HTTP on other forums dedicated to such matters.
Ohh, I'm Extremely sorry for the delay.
I didn't got any notifications (I don't know why)
And I thought no one replied me.
//---
Actually, I wanted to send message to telegram and retrieve them from there.
I know how to send telegram message, but don't know How to retrieve them.
Earlier I was asking for JSON, because I thought I will send trading information (like which trade is opened and which is closed)
but then I thought Telegram will be better
But I don't know how to retrieve messages from telegram.
Can you please help me with that?
I really really appreciate your help.
Earlier I was asking for JSON, because I thought I will send trading information (like which trade is opened and which is closed) but then I thought Telegram will be better
But I don't know how to retrieve messages from telegram. Can you please help me with that? I really really appreciate your help.
Learn to use the search function. Search in the CodeBase, search in the Articles, search the internet and most obviously, read Telegram's own documentation on their API.
But Still can't find How to retrieve Telegram Message.
Can you please Help me with that?
It will be great if you help me a bit with that.
Sorry, but that cannot be resolved will simple guidance. The Telegram API is quite complex. Detailed mentoring is beyond the scope of what I am willing to do on a public forum.
Doesn't work anymore. The request is blocked by Cloudflare on behalf of ForexFactory. Didn't try the other link (https://www.mql5.com/en/code/15931) yet.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to send GET and POST request to API.
but i didn't know how to do it so i searched for it and found official documentation : WebRequest - Common Functions - MQL4 Reference
And I tried it's examples code with some different API's
but i don't know how to use JSON Header.
Can some one please help me?
And
As there is very very less content is there on internet about api request in mql, It will not help me only but other peoples too.
Thanks for Reading.