Calling WebRequest from CustomIndicator Function ?

 

Hello Fellow coders and traders.

I have lately quite appreciated that MQL4 and 5 language have the native Web Request function: https://www.mql5.com/en/docs/network/webrequest

So far I did not have any success using this WebRequest function for Custom Indicator.

Is there anyone successfully using this native Web Request function or something similar to call website page for Custom Indicator ? (except using any of external dll files like wininet.dll stuffs.)


Kind regards.

Documentation on MQL5: Common Functions / WebRequest
Documentation on MQL5: Common Functions / WebRequest
  • www.mql5.com
Common Functions / WebRequest - Reference on algorithmic/automated trading language for MetaTrader 5
 

Documentation says:

The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If you try to call the function from an indicator, GetLastError() will return error 4014 – "Function is not allowed for call".  

I think that use wininet.dll functions is only way to call website. 

 
Janusz Trojca:

Documentation says:

The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If you try to call the function from an indicator, GetLastError() will return error 4014 – "Function is not allowed for call".  

I think that use wininet.dll functions is only way to call website. 

Thanks very clear plus good answer. :)

If we could call script or expert adviser from our custom indicator in regular time interval then we might be able to achieve this without using winner.DLL file. 

Just one more idea. :)
 
Yeah. This is another way to realize this idea. It is possible to call script from indicator, but I'm afraid that it needs another dll file (user32.dll).
Reason: