423 questions
0
votes
0
answers
64
views
How to specify the color of an indicator used in expert adviser?
My Expert Advisor uses two Moving Averages (MAs). I want them to be displayed on the chart with two distinct colors, like in this example:
However, my EA draws both of them with the default color (...
1
vote
0
answers
44
views
Make Fractal Indicator to start FRom Desired Candle number
Hi i Want to make this show Fractal from My desired Candle Index Number TO Latest Candle
but if i change start to a number and rate total-3 in for Loop It doesn't work what would I Do ?
i want to test ...
0
votes
1
answer
63
views
Is there a way to draw a dashed line on a MQL5 chart that contains two colors?
I have an indicator that draws dashed lines in red or blue as needed for support and resistance levels. However, I have a difficult time seeing the lines on the black background charts, so I would ...
0
votes
1
answer
54
views
ChartHeightInPixelsSet in MQL5 does not work
I have written the following codes in my Metaeditor, but it does not work.
void OnInit()
{
ChartHeightInPixelsSet(500, 0, 1);
}
bool ChartHeightInPixelsSet(const int value,const long chart_ID=0,const ...
0
votes
1
answer
39
views
How can I detect when MACD visually touches the RSI in an MQL4/MQL5 indicator window for trade signals?
I'm developing an Expert Advisor in MQL4/MQL5 that should trigger trade orders based on the visual interaction of two indicators—the MACD and the RSI—displayed in the same indicator window. The idea ...
2
votes
1
answer
48
views
MACD in Debugging Mode and not plotting the oscillator
I’m developing an MQL5 Expert Advisor based on MACD crossovers
//+------------------------------------------------------------------+
//| Expert initialization function ...
1
vote
0
answers
80
views
MQL5 Position closing function does not close positions as expected, where am I wrong?
I'm developing an EA in MQL5 that should automatically close open positions when the money profit reaches or exceeds a profit target of 20 or falls to -100. I have tried using both trade.PositionClose(...
0
votes
0
answers
25
views
How do we draw trend lines without using Object Create?
I have the following property
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
#property indicator_label1 "Trendline"
#property indicator_type1 ...
0
votes
0
answers
292
views
'<' - open parenthesis expected
I am trying to develop an Expert Advisor (EA) for MetaTrader 5 using MQL5, but I keep encountering the error '(<) - open parenthesis expected' for the following:
if (Bars < 3)
Here is a snippet ...
0
votes
0
answers
135
views
VS Code autocomplete with MQL 5
I have installed VS Code for writing MQL Expert Advisors along with MQL Tools extension.
I have no problems with compiling. However, the autocomplete is only partially working. Some functions for the &...
0
votes
1
answer
57
views
How can I connect close price of candles?
I am new to mql5. I want to write the code to connect the close prices of candles to each other in an expert advisor file.
In Pine script, it is:
plot(close)
In mql5 I can use something like this, ...
0
votes
1
answer
65
views
MQL5 file file creation and content management
I am trying to code in MQl5, the code aims at collecting currency historical data. From here I use FileOpen() function with all flags as shown on the images. Code is successfully compiled with no ...
1
vote
0
answers
36
views
Why are upper and lower pitchfork lines staying red in MetaTrader 4?
I’m working on an MQL4 code for MetaTrader 4 that creates a custom Pitchfork with three lines: the central, upper, and lower lines. The central line, which is supposed to be red, works correctly. ...
0
votes
1
answer
33
views
Is it possible to prevent two buttons from stacking in the same position in MQL5?
I am a trading developer.
I am developing a GUI with mql5 and there are two tags on top. When I click on a tag, it hides the current section and shows another section. But there are two buttons (show, ...
0
votes
0
answers
93
views
Trying to get the yesterday high and low drawn on today chart along with percentages
Im having issues with my mql5 script to get the previous days high and low and display it on the next day along with the 25%, 50% and 75%. The high and low sometimes don't cover the entire day and the ...
0
votes
1
answer
45
views
pine script - reffering to previous values of local variable
i have this function but i can't understand _f[1],_f[2],... values . _f is local variable of function so my question is are _f[1] reffer to value of _f in previous run of function? or something else.
...
0
votes
0
answers
128
views
how to bind zeromq (libzmq.dylib) with mql 5 on macOS
I am trying to write a trading bot using C++ in vscode which will be connected to metatrader 5 via binding (zeromq) on macOS. But after I installed brew install zeromq and also moved the zmq.h to :
&...
0
votes
1
answer
46
views
Failing to Identify the best way to set a Moving Average Threshold to use in my MQL5 EA
Iam writing code in MQl5 for an EA that uses Moving Average. I have a part where I get the Moving Average value at that point and compare it with a value which is the moving average threshold after ...
0
votes
1
answer
523
views
MQL5 How to find lastest history order ticket?
I am writing an EA program using MQL5, and now I encounter a problem. I want to get the order number of the last closed order (as shown below, the target order number is 2308697611). I have tried many ...
0
votes
2
answers
192
views
How to create MQL5 Keltner Channel programmatically
I'm trying to create/use Keltner Channel indicator in my MQL5 Expert Advisor but for some reason it is not working. I know that at the moment MQL5 doesn't have a built-in indicator, so I am trying to ...
0
votes
1
answer
158
views
Convert function average price MQL4 to MQL5
My code below calculate average price in MQL4 and it run ok How to re-write it in MQL5.
void getAveragePrice()
{
double sum_lot_b = 0;
double sum_price_b = 0;
double sum_profit_b = 0;
...
0
votes
1
answer
221
views
Whats the difference between telegram user messages and bots?
I have a telegram bot recieving webhooks which work. But a MT5 EA does not trigger trades. (Left side of image). But when I type manually in the same telegram bot, the trades do work. (Right side of ...
1
vote
2
answers
506
views
Check if SMA is below certain RSI level in MQL5 programming
I'm new to MQL5 programming and I'm trying to create my first Indicator. I would like to be able to tell if the current moving average is below level 10 in the RSI.
The image below explains what I ...
0
votes
0
answers
2k
views
News Filter EA for MT4
I am builing an EA which fetch news from http://nfs.faireconomy.media/ff_calendar_thisweek.xml and set the values to variable News_Trade_Status
Logical Conditions (required):
Before X minutes from ...
0
votes
1
answer
1k
views
Indicator values on "metatrader 5 tester" not updating even though my code looks correct
So the problem im expiriencing is that when i run the built in mql5 tester, my indicator values dont dynamically change, they keep a constant value, even though i wrote the code so that the indicator ...