mql4

How can someone send data from MetaTrader 4/5 Terminal to external server?

血红的双手。 提交于 2020-01-11 07:39:06
问题 this is somehow intended to (maybe) be(come) a guideline post in terms of MetaTrader 4/5 and its corresponding language MQL4 both set into context with sending data to external servers. In my special case I am building a Django/Python based web application that will process FOREX trading data for further use. Thus, I am in search for a proper solution to send data from the MetaTrader 4/5 Terminal to an external server periodically (e.g. every 60 seconds) formatted as json or csv (if possible)

mql4 : coding empty buffer in line

无人久伴 提交于 2020-01-06 06:40:49
问题 so I make some coding and now have empty buffer I want to ask how to feel EMPTY_BUFFER so if use IF line == EMPTY BUFFER then FILL IT..i already try some coding but still not fill the empty buffer #property strict #property indicator_level1 75.0 #property indicator_level2 25.0 #property indicator_levelcolor LimeGreen #property indicator_levelwidth 1 #property indicator_levelstyle 0 #property indicator_separate_window #property indicator_buffers 5 #property indicator_color1 Green #property

Can I use languages other than MQL4 on MetaTrader4?

心不动则不痛 提交于 2020-01-01 09:45:53
问题 I have a task of migrating a C# market strategy to MetaTrader. Is there any way to automate that job? (For example, is it possible to parse C# into it's AST, then make the translation?) Does MetaTrader accept other languages by any means? 回答1: Approach the task Bottom-Up -- Architecture-wise Yes, you can simplify the trouble and make MT4 become a Node, which is immediately connected peer-to-peer to your current C# Market Strategy. This alowed me to operate a cluster-based computing

Executing an URL from MQL4

橙三吉。 提交于 2020-01-01 07:11:05
问题 On my MQL4 Code I need to execute an External url/link in order to update a table, I have Added the URL in the Allowed URL List Option. However I got the following error : Any Idea how to solve this problem ? Thanks . PS: I am using MT4 Build 840 回答1: This warning reminds you to set ( check [ x ] ref. Fig1 below ) permit(s) to do so in your MT4 Terminal Tools -> Options ( Ctrl + O ) Both the [Allow automated trading (Expert advisor per se )] and [ Allow WebRequest for listed URL: / Add a

How to return a string from a C++ DLL into a MetaTrader 4 code-execution ecosystem?

浪子不回头ぞ 提交于 2020-01-01 06:39:15
问题 I have following function __declspec(dllexport) wchar_t* __stdcall __getJson(wchar_t * listN){ setlocale(LC_ALL, ""); //function logic wstring ant = utf8_to_wstring(result); const WCHAR* constRes = ant.c_str(); WCHAR* tempObj=new WCHAR[ant.length()]; wcscpy(tempObj, constRes); thread Thread([tempObj]{ Sleep(1000); delete[] tempObj; }); Thread.detach(); return tempObj; } This DLL returns wchar_t* to MetaTrader4. I tried many ways to return correct value and avoid memory leaks such as set

MT4 Manager API => .Net ClrWrapper

﹥>﹥吖頭↗ 提交于 2019-12-25 17:14:09
问题 I am using mtmanapi.dll with a .Net CLR wrapper I am getting correct Ask and Bid values for symbols without any special characters in the Symbol name - ( e.g. EURUSD , GBPUSD and so on ), but if symbols have some special character in it ( e.g. EURUSD' , GBPUSD0 and so on ), then it's not fetching Ask and Bid value using a SymbolInfoGet() method. 回答1: It should work and below code returns quotes for US100, OIL.WTI, 225JPY from my server. I am using SymbolInfoUpdated() however it's similar to

MQL4: Read single value from CSV

梦想的初衷 提交于 2019-12-25 08:15:59
问题 I'm trying to fetch one value from the data source website Quandl to be used within a MetaTrader4 script. The data source site provides a method to export data via API formats including .csv , .json or .xml . I have chosen the .csv format, which the data source website then provides an API call for me to use in the following format: https://www.quandl.com/api/v3/datasets/ADB/LAB_UNEMP_JPN.csv?rows=1&api_key=my_api_key By using the rows=1 parameter in the above API call , I can choose to just

Why am I getting an array out of range error in this code?

无人久伴 提交于 2019-12-24 16:43:41
问题 Initial Problem I am trying to plot the RSI of an indicator, "xxx.mq4", as follows: #property indicator_buffers 1 #property indicator_color1 Red #property indicator_width1 2 //---- buffers double ExtMapBufferCustomIndicator[]; double ExtMapBufferRSICustomIndicator[]; int i; string s="xxx"; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //--

Why am I getting an array out of range error in this code?

南楼画角 提交于 2019-12-24 16:42:39
问题 Initial Problem I am trying to plot the RSI of an indicator, "xxx.mq4", as follows: #property indicator_buffers 1 #property indicator_color1 Red #property indicator_width1 2 //---- buffers double ExtMapBufferCustomIndicator[]; double ExtMapBufferRSICustomIndicator[]; int i; string s="xxx"; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //--

Order Sent Failed with Error #130

孤者浪人 提交于 2019-12-24 15:03:47
问题 I'm trying to insert a takeprofit and stoploss argument in my SendOrder() function, but I'm getting the following error: Order Sent Failed with Error #130 This is my code: extern double takeprofit = 30.0; extern double stoploss = 20.0; stoploss = NormalizeDouble( stoploss, 5 ); // SET stop loss Print( "stoploss", stoploss ); takeprofit = NormalizeDouble( takeprofit, 5 ); // SET take profit ticket = OrderSend( Symbol(), OP_SELL, lotsize, Ask, 100, stoploss, takeprofit, 0, 0, 0, CLR_NONE ); if