mql5

Dependant DLL loading issue in MQL5 from C#

微笑、不失礼 提交于 2020-12-15 05:18:04
问题 I have this code for MQL5. #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 #import "Indicator\\..\\Libraries\\PythonConnect.dll" int OnInit() { //--- return(INIT_SUCCEEDED); } int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- Print(PythonConnect1:

An OpenCL code in MQL5 does not get distributed jobs to each GPU core

做~自己de王妃 提交于 2020-12-05 08:21:47
问题 I have created a GPU based indicator for MetaTrader Terminal platform, using OpenCL and MQL5. I have tried hard that my [ MetaTrader Terminal: Strategy Tester ] optimization job must get transferred on GPU to maximum. Most of the calculations are done by the indicator. Hence, I made changes in the indicator and has completely transferred on GPU. But the real issue arises when I try to go for optimization process in the strategy tester section. The process I see uses both my GPU and CPU but

How to use CopyRates() to search and filter through several timeframes for Bullish Engulfing pattern

北慕城南 提交于 2020-07-01 10:43:24
问题 The bounty expires tomorrow . Answers to this question are eligible for a +100 reputation bounty. SuperHueman wants to draw more attention to this question: To receive this bounty, a user should provide tested code on finding all bullish engulfing patterns on timeframes H2 to M10 within a bullish H4 candle using CopyRates(). From the found bullish engulfing patterns the one with the highest bearish to bullish candle body ratio should by filtered out searching through with CopyRates(). Note

How Close an MT5 Order from Python?

删除回忆录丶 提交于 2020-06-26 14:33:18
问题 I'm trying to send orders from a python script to my MT5 terminal via the MT5-python API. I can open a position but how can I close it from Python mt5-API? I open a BUY ticket it like this: import MetaTrader5 as mt5 lot = 0.1 request = { "action": mt5.TRADE_ACTION_DEAL, "symbol": symbol, "volume": lot, "type": mt5.ORDER_TYPE_BUY, "price": price, ..... "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_RETURN, } enter copoint = mt5.symbol_info(symbol).point But what command and

How to search for a candlestick pattern on multiple timeframes

懵懂的女人 提交于 2020-06-21 05:26:06
问题 I have an expert advisor that draws rectangle on a specifically defined bearish pinbar followed by a bullish candle. Please see the code below. It basically shows the rectangle on the timeframe displayed on the chart. How can I search for this candlestick pattern on timeframes within an H1 candlestick down to M2 in such a way that I can filter the pattern that has the longest bearish pinbar from all timeframes? string prefix="PBar"; int magicnumber = 12345; bool drawBearPinbarRectangle(int

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

Converting mql4 EA to mql5

泄露秘密 提交于 2020-04-07 03:20:31
问题 I have been trying to figure out how to change my MQL4 code to MQL5. So far I've been able to change the RSI and MACD conditions and SendOrder() but there's a lot, like the ModifyOrder() and CloseOrder() amongst other stuff that I've not been able to do to complete it. I know this is a mouthful but I would really appreciate some help in completing this. This is the original MQL4 code: extern int MagicNumber=112223; extern double Lots =0.005; extern double StopLoss=0; extern double TakeProfit

Converting mql4 EA to mql5

对着背影说爱祢 提交于 2020-04-07 03:20:28
问题 I have been trying to figure out how to change my MQL4 code to MQL5. So far I've been able to change the RSI and MACD conditions and SendOrder() but there's a lot, like the ModifyOrder() and CloseOrder() amongst other stuff that I've not been able to do to complete it. I know this is a mouthful but I would really appreciate some help in completing this. This is the original MQL4 code: extern int MagicNumber=112223; extern double Lots =0.005; extern double StopLoss=0; extern double TakeProfit

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) => {