Expert Advisors and Automated Trading - page 36

Hello, I am new in MQL5. I am trying to get the last three bars of EURUSD. As I am writing this post, it should return the last three bars, which were on 08.12.2023. But it returns the bars from 01.12.2023. What is wrong with my code? void lastBars() { // this array will hold the last 30 bars
this the code below, the rectangle showing but background color does not show ObjectCreate ( 0 , "RECTANGLE_LABEL" , OBJ_RECTANGLE , 0 , x, fromRange, x2, toRange); ObjectSetInteger ( 0 , "RECTANGLE_LABEL" , OBJPROP_COLOR , clrYellow ); ObjectSetInteger ( 0 , "RECTANGLE_LABEL" , OBJPROP_BGCOLOR
I have a nice EA and would like to add the function where an order will close when it gets to a specific profit (dollars). I am trying OrderProfit() but have no luck in getting the EA to respond. It's pretty simple. I want to enter a dollar amount into the EA settings, and when the profit reaches
Hi, thanks for all , I want to copy the historic buy and sell prices. what can I do for that? my respects to everyone
We have interfaces in MQL but they really don't provide much value than just using an abstract base class in my opinion. Interfaces become alive when you can inherit a class from multiple interfaces. interface IIsStringable { string ToString() const ; }; interface IIsWaitable { bool IsReady()
Hi All! Im having a problem using the strategy tester. After an update of mt5, the strategy tester is not respecting the stop loss or take profit anymore. (picture attached) The code is simple and it was working perfectly before. And it is working in real time in a demo account too. I tried...
The Balance/Equity graph in MT5 backtest report HMTL is wrong. Equity curve is missing in the generated HTML. The graph is correct in MT5 Client Terminal though. Please see the picture attached. First 2 shoe the client Terminal graph and the last one in the report HTML. Please help
Hello friends It seems new version of MQL5 have problem to get the value of Period, I have tried both " Period() , _Period " But the out come is wrong I write this simple code, and change time frame to check the result, But the out come is Wrong !!! I use MQL5 version 3030 int OnInit () {
Hello I use MSQL5 and metatrader5 When I change the Height of oscillator window by ChartSetInteger() function it works but after that I can't change the height by mouse the code is : for ( int w= 0 ;w<windows;w++) { int total= ChartIndicatorsTotal ( 0 ,w); //--- Go through all
i am creating a EA through meta editor using custom through expert advisor(generate) it work well in all script expect NAS100,when i attempted to add it on NAS100 chart it simply disable, somebody help
Does anyone know a way to detect a datatype from a string value? This can be important when reading from a CSV file, as we all know mql5 reads a csv file as a data of one type it, for example reading the information from a CSV as strings which works better and gives you the option to convert the
Hello, i have a doubt about something i can't find anywhere in the site. I currently have an EA running in MQL5 VPS. If i would like to purchase and launch another EA or a signals service, but would prefer to avoid messing up with the current EA running (in terms of risk, money management, etc...)
  OnnxRun failure  (5)
Hi community, I'll try to run my onnx model without any success. Here after are the steps : - I use OnnxCreateFromBuffer to create my handle from my model --> it's ok my handle is not invalid onnxModel= OnnxCreateFromBuffer (ExtModel1, ONNX_DEFAULT ); if (onnxModel== INVALID_HANDLE ) {
I am using MT5 and MoneyFixedRisk.mqh or MoneyFixedMargin.mqh Its pretty much fully implemented for me, the only problem I have is this: Lets say I am risking 100% of the account, I set a SL that is 0.25% away from the entry. The problem is I get stopped out (or margin call) before it reached the
Hello. I'm using metatrader strategy tester agent and i can't seem to connect to the cloud network. The cloud network worked for me in september but I've had some problems to connect back to it. I've tried to reinstall it but it wont work. How do i fix this
  use MqlTick  (2)
hello, how can i use MqlTick for a result of buy deal or sell deal ? thanks
Hello, My EA is on the MQL VPS and is currently working fine, looked at the logs and it shows that the EA is synced to the chart. However, whenever I open terminal, it doesn't show the EA as active on the chart. Is this normal, or do I need to fix it? Is it like that for anyone else
Good evening everyone, I have written a function which draws a line from the last 3 fractal highs/lows until it is broken by the price. This works in 90% of the cases, but there are always situations where the line goes further than it should ;) Maybe someone can have a look at the code and see if
hello everyone I am completely new in MQL. Is there anyone who can help me in my first EA to read my last order details (symbol, type, closing price etc) and open a new position after a certain pips for the same symbol? Sorry I know this might be a silly question but your answer will help me to get
Hi Friends I have a array of negative or zero values. I can find Minimum Lowest (-veLowest) by ArrayMinimum() method. Is there any function which I can use to find Maximum Lowest (-ve Highest) ? Currently I am using following code, but is there a better way to get this information
Hello, Let me explain better what is my problem and what would be a solution. How I work: Normally I use back test kicker to do a few back tests in a row and then analyse everything to select the best sets. I already have a system to read, organize and filter the best results with a excel file
Hi, I have used forward declaration before, but for some reason this situation fails. Any idea what I'm doing wrong? I have attached the necessary files also. #include<Test\Foo.mqh> #include<Test\FooNode.mqh> Foo<FooNode*> foo; int OnInit () { return ( INIT_SUCCEEDED ); } void OnTick () {
  EA scams  (64   1 2 3 4 5 6 7)
Does no one check sellers code for scams. For example this guy shows his EAs winning but they only win up until the last upload date and then they lose. He obviously has the data loaded in the EA For example, his program was last updated on 28th february 2023 and you can see the great results before
  AWS based EAs  (1)
Hi ! I am developing some EAs that are integrated with the AWS cloud. In the cloud, machine learning models receive the candles and generate buy or sell signals. Is anyone working with this architecture too? I would like to exchange experience about this approach. I wrote MQL5 libs for integration
Hello, I am new in MQL coding, I am trying to calculate profit from an open price (set in an input variable), the code is below. The problem is OrderProfit() is returning a different value with my code. =================== //+------------------------------------------------------------------+ //|
Hi all. Trying to do mt5.initialize() (in python). Works about half the time. The other half of the time it times out, and then continues doing so on subsequent tries, for extended periods (sometimes hours) before it works again. When it times out, then I check why with mt5.lasterror(), and the
Hello, I am brand new to MT5, and the Python intergration is what really appeals to me. I went to File--> New and selected Python Script. then went to Matplotlib. and wrote a basic script import MetaTrader5 as mt5 import matplotlib.pyplot as plt from datetime import datetime # Initialize connection
i want to OPEN position after reading a file. the file isupdate on event by program not mql. how to detec file change and get last position before update to continue for the next reading the file. input int InpEncodingType=FILE_UNICODE; // ANSI=32 or UNICODE=64 int OnInit () { //---
Hello everyone. l realize many people buying the same product from market and apply it with same settings to pass challenges of the same firm. How could this be possible? isn't it close to what they call copy trading which is not allowed in prop firms
What do I need to change in meta editor to enable it to use GPU I have the setting enabled but from my understand I have to input some code so I can use the resources in my computer