metatrader4

How do I convert a VB delegate into a python event handler?

守給你的承諾、 提交于 2020-12-12 12:23:46
问题 I have to rewrite the following VB code that is subscribing to a delegate (event), into python, using python.net. Imports MtApi Public Class Form1 Private apiClient As MtApiClient Public Sub New() InitializeComponent() apiClient = New MtApiClient AddHandler apiClient.QuoteUpdated, AddressOf QuoteUpdatedHandler End Sub Sub QuoteUpdatedHandler(sender As Object, symbol As String, bid As Double, ask As Double) Dim quoteSrt As String quoteSrt = symbol + ": Bid = " + bid.ToString() + "; Ask = " +

How can I recognise programmatically when an up/down arrow is drawn on a chart when arrow objects are hidden?

浪子不回头ぞ 提交于 2020-05-28 04:25:51
问题 I know how to draw an object arrow on the chart, which I usually do like this: ObjectCreate(0,"prevHigh",OBJ_ARROW_DOWN,0,Time[0],High[highestCandle]); ObjectSetInteger(0, "prevHigh", OBJPROP_COLOR, clrRed); Now I have an indicator which (I didn't code myself and is a .ex4 file which) draws up/down arrows on the chart as seen in the image (https://imgur.com/a/8yG0suw). How can I when for example a Magenta down arrow has been drawn and the candle (index) at which it is drawn? Please note that

Processing json string in mql4

跟風遠走 提交于 2020-04-17 18:46:11
问题 I have received the following string: {"records":[{"id":"rec4haaOncoQniu8U","fields":{"orders1":5},"createdTime":"2020-02-08T09:08:22.000Z"}]} I am not understanding how I can process and separate the values of the json in mql4 using the "JAson.mqh " library, located here: https://www.mql5.com/en/code/13663 I need the values of "orders" located under "fields" , value = 5 . the only "KEYS" that changes are the keys within the "fields" values. i would like to be able to get the values with

Processing json string in mql4

谁说我不能喝 提交于 2020-04-17 18:43:55
问题 I have received the following string: {"records":[{"id":"rec4haaOncoQniu8U","fields":{"orders1":5},"createdTime":"2020-02-08T09:08:22.000Z"}]} I am not understanding how I can process and separate the values of the json in mql4 using the "JAson.mqh " library, located here: https://www.mql5.com/en/code/13663 I need the values of "orders" located under "fields" , value = 5 . the only "KEYS" that changes are the keys within the "fields" values. i would like to be able to get the values with

I can't grab/print data on the pull instance using plain zeroMQ Push/Pull pattern

拥有回忆 提交于 2020-03-21 10:10:49
问题 I am having tough times to grab and print data which is successfully pushed to the wire. I have set up a plain Push-Pull-Architecture with Metatrader 4 acting as producer and Python backend acting as consumer . When it comes to grabbing and printing the data, I just cannot make it happen. This is my push instance which works just fine: Metatrader 4 zeroMQ push instance: #include <Zmq/Zmq.mqh> // EA plot settings extern string PROJECT_NAME = "Dashex.Feeder"; extern string ZEROMQ_PROTOCOL =

How to post from MetaTrader Terminal 5 MQL 5 a request to my nodejs server, which is running locally on my MT5 host?

半城伤御伤魂 提交于 2020-03-18 09:01:41
问题 I'm trying to get FX rates in my nodejs server and socke.io emit them to the client, while running MetaTrader Terminal 5 or 4. So I guess I have to use MQL4/5. I know how the handle the request in my nodejs server. What I dont know is where to write the MQL4 code, what to config in my MetaTrader Terminal. Lets say I want to send EUR/USD bid rate to my nodejs server everytime it gets changed. How do I achieve that, using MT4/5 and MQL4/5? My nodejs code: app.post('/fxroute', (req, res) => {

How to post from MetaTrader Terminal 5 MQL 5 a request to my nodejs server, which is running locally on my MT5 host?

你。 提交于 2020-03-18 08:59:28
问题 I'm trying to get FX rates in my nodejs server and socke.io emit them to the client, while running MetaTrader Terminal 5 or 4. So I guess I have to use MQL4/5. I know how the handle the request in my nodejs server. What I dont know is where to write the MQL4 code, what to config in my MetaTrader Terminal. Lets say I want to send EUR/USD bid rate to my nodejs server everytime it gets changed. How do I achieve that, using MT4/5 and MQL4/5? My nodejs code: app.post('/fxroute', (req, res) => {

How can I write an mt4 indicator that draws a rectangle and horizontal lines over first 6 hours of hourly candles

核能气质少年 提交于 2020-01-24 09:20:12
问题 I am a quite new to mql4 coding. I would like to know how I write an indicator that does the following, based on the image below: Draw a rectangle over the current day hour chart that covers the highest and lowest price points of the first 6 hours (candles) Draw two horizontal lines along the highest and lowest points found 1. Please note that 1. and 2. should be based strictly on the hourly period and shouldn't vary with the selected period. I believe I'm suppose to be using ObjectCreate()

How can I convert Metatrader 4 alert or email indicator signal to Expert Advisor to open trades?

筅森魡賤 提交于 2020-01-22 19:53:43
问题 I have been using an indicator to take trades. I didn't develop the indicator, so I only have access to the .ex4 file. How can I extract the take profit, open trade and stop loss values in the alerts or email signals to open trades? Please see a sample of the email and alert signals below. 回答1: Here is a working example script of a native MQL solution which uses kernel32.dll to copy the log file from ./MQL4/Logs to ./MQL4/Files . The LogSignalParser abstract base class needs to be subclassed

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)