Expert Advisors and Automated Trading - page 37

Hi there, void OnStart () { //--- request all the existing history on the account if (! HistorySelect ( 0 , TimeCurrent ())) { Print ( "HistorySelect() failed. Error " , GetLastError ()); return ; } //--- get the number of deals in the list and display it in the journal
I would be grateful if you could solve the issues with this code
Hi I have to separate the letters of a word , for example "USDJPY", then change it to "U,S,D,J,P,Y". I mean using a Comma or Slash between it's letters. can you help me please
hi there when testing an EA and stopping it in middle of test, the deinit function is not called. i checked this multiple times and read the documents. i have an object that writes csv journal files and in the end (when EA is closed or stopped) i need to add a summery and i decided to do it in
Hello people, I'm experiencing issues importing E-Mini Nasdaq100 Futures (NQ) data into MetaTrader 5 for backtesting purposes. Following the custom symbol guide, I attempted to import 1-minute historical data from January to October 2024. I copied the ENQZ24 symbol and created a custom symbol
Greetings, I am struggling to get rid of a panel's close button. The reason to do such thing is, I successfuly created a CAppDialog panel with a guide found on YouTube, and one of the buttons should wipe all the objects created by the expert so far, but since it is irreversible, I want a
Is there a programagic way (like SymbolInfoDouble, or AccountInfoDouble) to get the broker's commission per lot. From the market watch window, I can get it by right click on a symbol -> symbol specs. Anybody has an idea how the market watch window implemented it? I suggest this feature should be
i tried to do a very simple test in onTick() function just very simple like buy the symbol when 8 days ma cross 20 day ma and close price higher than 20 days ma on 1H graph. for both ma, i use bar close. and check if ma1.Main(0)>ma2.Main(0) && close>ma2.Main(0) as far as i know, this statement will
Hi, I am testing a strategy for the US500 with the python API. My broker ( [redacted] ) has a maximum lot limit of 250 that's creating some issues. For example, if I have $200,000 in my account with 50x leverage (which is not too much for 1 or 5 minute bars outside of peak hours), it would give me
Hey all, I run optimized tests, selected a result that I liked and run the single test but even though the number of positions and profit was the same, the drawdown wasn't. See images. Anyone knows why it might happen? This is how I run the single test This is how I run the optimized test Thanks
I want to use the object manual interaction function during backtesting, but I found that the OnChartEvent() function does not work during backtesting. How should it be set? Or is there any other good way
Could someone please help me with this error "- open parenthesis expected" it happens at line 8 and line 22. I don't know what to do. if (range > 650 * Point) if (total_range > 100 * Point) // Function to check the candle condition bool CheckCandleCondition() { // Get the high and low prices of
I have a simple EA that closes my orders at a time that I specify with inputs. At the moment it closes ALL my orders but I'd like to update this EA to only apply to the symbol NZDCHF . Something to note is that I trade multiple accounts that have different names for the same symbol, such as
I have an EA in MT5 which is designed to convert messages into a trade. The connection works, but I have encountered an issue I don't know how to fix. In telegram, I made a bot which recieves webhooks from tradingview. These messages are correctly recieved and displayed on the chat. However the
Hi, I'm trying for the first time this class and followed this guide https://www.mql5.com/en/articles/481 . Problem is that after placing the order I need to get the ticket because I'm trying to manage the operations by myself. The problem is that even the operation is placed and it has a ticket, a
when we creat OBJ_EDIT, we can modify its value manually. But on backtest, if we modify it's value, it can not change. How to solve it
When I access MT5 from python, I can get date and price information, but not last and tick_volume. I couldn't get them with my own code, nor with the official sample code. The result is always 0. from datetime import datetime import MetaTrader5 as mt5 import pandas as pd if not mt5.initialize()
Hello everyone, I'm trying to develop a pattern robot, it should send the signal at the OPENING of the ZERO candle ( O[0] ). It is sending correctly on the Zero candle, but on the next candle it sends the pattern again, even though it is a new zero candle and the pattern is already one candle
Hi i am developing a backtester in python so i have tried to use the official python example https://www.mql5.com/en/docs/python_metatrader5/mt5copyticksrange_py to copy ticks but the volume seems to be always 0. is there any way i can get the volume information as well. Thanks in advance
Do you think anyone can help to explain what is the reason the order will be cancelled automatically? I am a newbie in the EA trade. Some setting was wrong
Hi I'm David, could anyone help me with a quick question: So basically I need a script that exports the trading accounts info that means (date, profit/loss, commission, etc.), and it has to do it automatically, how do I procede ? Thanks. :)
Hi, I am new in mt5. i am confused about the price used in back test. something very simple as below. i hope someone can confirm my understanding CSymbolInfo info; void OnTick () { double ask=info.Ask(); double close= iClose ( NULL , PERIOD_CURRENT , 0 ); if (ma1.Main( 0 )>ma2.Main( 0 ) &&
hi i need help with my code error 'iMA' - wrong parameters count KILANGI DREAM.mq5 43 21 built-in: int iMA(const string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,int) KILANGI DREAM.mq5 43 21 'iMA' - wrong parameters count KILANGI DREAM.mq5 44 21 built-in: int iMA(const
Error, martingale calculation. the doubling of the lot in the martinagale strategy proves to be inconsistent. It jumps from 0.1 to 0.2 to 1.6, after the take it goes back to 0.1 and then jumps to 0.8. Which part of the code could be the problem
Hey all, I would like to ask how to get the exact values of mql calendar ? I already got the value and divided it with 1 million as suggested, but it is still rounding up . I tried typecasting as well but still the same. In this case, the exact value is 46.5, but it keeps producing 46 as the value
  please help  (3)
hi, can someone please help me with this: I'm trying to get the correct account balance at the start of the month (1st), the code so far does give me the correct balance when the month changes to a new month, but the problem is when the EA is loaded the start balance of the month is reflected as
Hi, I am in the process of getting to know various Expert Advisors. When I install one for free, I can only test it using the 'start test' button. I cannot run it unless it's for testing purposes. What can I do? I have installed several, but I can only start them as a test, no matter which one
I am new to MT5 and I copy a code from https://www.youtube.com/watch?v=d9-_bb58PgE and https://www.youtube.com/watch?v=PgxhNRoe4AM and It says there are errors. //+------------------------------------------------------------------+ //|
Hi, I have this pc with 32gb RAM, during optimization truckloads of data are written to my Windows disk which affects my disk health. Now, I am aware of the fact that reducing agents will prevent this from happening but then the whole process takes much longer and it already takes ages with all
Hi there, I am very new to MQL5 and trying to create custom indicator //+------------------------------------------------------------------+ //| Hull_info.mq5 | //| Copyright 2024, MetaQuotes Ltd. | //|