Expert Advisors and Automated Trading - page 79

can someone help me with adding a function to close open buy position when my two moving averages crossover takes place
@Lorentzos Roussos @Dominik Egert I was just trying to start with Matrix and Vectors, but reading this thread ( https://www.mql5.com/en/forum/448355 ) makes me think again. Tell me frankly man, is it worth to invest time in learning them? The documentation is very poor to explain the correct ways
been working on this inside bar expert advisor and i had issues with it giving continuos non stop alerts but tried to solve it but now it wont compile because of a unbalanced parenthesis on the "void OnTick(){" line 23 in the code below. can you guys please help me balance the parenthesis as i have
Hi I would like to ask some help in my search for the correct tick value. In both MT5 and MT4 the tickvalue is sometimes set in a different currency then the deposit currency. When you place an order and DRAG the order up or down to set TP or SL the "value" is based on deposit currency. See the
I created an AI trading bot in MetaTrader 4 and 5. Implemented a Python script to use the AI model and integrated it with the EA using socket communication. Runs well for one forex pair. Now I want to increase my Forex pairs and trade with more pairs. So, I need to develop several Python scripts for
Hello everyone, I've been trying to create a code to count candles from the last pending order, so that after x candles of the pending order, it automatically cancels. However, I didn't get to the calculation, could someone give me a tip
I used this color codes as input parameters. The I used them to modify object colors . but it does not work. I checked the EAs input menu, all the colors are pre-selected to black. even though correctly declared them. input color Monthly_Resistance = clrCrimson; input color Monthly_Support =
Hello, I'm having trouble finding a good logic to notify me of each Open/Close event. My issue is that sometimes there are multiple Opens or simultaneous Closes, and I would like each one to be correctly notified. I'm thinking of using `ontrade()` - but I'm having trouble using this function
I'm copying a signal using 95% of my deposit and don't copy any other signals on that account. The signal's leverage is 1:300, mine is 1:500. I read the explanation for the calculation of relative lot sizes: https://www.mql5.com/en/forum/215636 Based on that explanation I would expect that the risk
Hello, I'm currently developing a system that initiates trades in the last 5-minute candle of every Monday. Ideally, most of these trades should hit the SL at the opening of the next day if there's been a bearish gap, as the SL is set at the lowest point of the current day. Upon backtesting, I
Hello, I have been trying to validate my EA for two days without success and despite the checks carried out, the tests concluding in real and in demo always the same message: test on EURUSD, H1 there are no commercial operations test on NZDUSD, H1 there are no commercial operations test on
I need to check either sell or buy positions runs at a time, also, I need to check either buy stop or sell stop placed in the current symbol. if you can give me an example for this, I can learn from it
I was working to implement a EA that utilize trailing stop losses, when doing so there were frequent invalid stops errors in journal. I had some research in the forum and test different solutions but non of them worked, this is the routine I use to modify stoploss: if there is required change of
So I want to subscribe to, for example, 4 MQL5 signal providers and I want their signals to be sent to one MT5 account. I posted on Reddit and got an answer before the moderator deleted it. He said, "Run 4 MT5 instances in portable mode, one for each signal provider, log into the same account on 4
Whenever I backtest, I look for the result with the higher (Profit / max drawdown) ratio. But in the optimization results tab there is no such a criterion, so after every backtest, I export the result as a spreadsheet and do the calculations there. I'm backtesting on a free EA, so I don't have
As i have to use real funds when subscribeing a signal, I have to match the balance on the account of the signal provider to get same lot size. How do i change/increase the lot size on my follower account with a lower amount of funds
I want to know how to set objects visible only for certain time frame. ex - Line 01 should be visible only for timeframes bellow 1h. I'm here in the Weekly timeframe, so I want to only to see monthly pivot points. Can you suggest me a function to achieve this? currently used this functions to draw
Hello. I'm looking for a way to find an EA's Equity Loss Maximal figure. And I don't mean the existing Equity drawdown maximal because I only want to know what was the maximum amount a position has dropped with respect to it's entry price, not to it's highest point. Anyone know of a way
I'm currently using TimeLocal(); function to get the time of the local computer. I use it to determine the trading session for the EA. Does this function works the same way in strategy tester because time is modeled in strategy tester. should I use another function instead of TimeLocal();
I want to include Telegram.mqh for the code script. but the following error pops up. can someone please help me to fix this. //+------------------------------------------------------------------+ //| MT5 to Telegram.mq5 | //|
[Deleted]
How can I check if there exists a pending order (in my case, a Buy Stop order) for a specific symbol?  
In this code, all I need to do is calculate the expire time to send the order. I did search for a method to do this, but I could not find it. Can someone please help me to figure out this?. I need to add 1 minute to the current time . I checked with a comment (The way I did in bellow code) it's just
I'm wondering if there is any way or tool to schedule an optimization process in MT5. My idea is to select, for example, 10 symbols, activate the process and allow once completed with one symbol, to automatically continue with the next, and then analyze the results later. Any hint is welcome. Thanks
Dears, as it is clear in subject i want to work with file in EA inside MQL5. be informed below code tested on MQL4 and worked properly. Also i know i should insert file in EA separately to be used (another WHY in MQL5) using below code #property tester_file "ALL_2018.csv" i created an array of
  WebRequest risks  (1)
Hello, Can anyone tell me what kind of information can a website get about my trades and terminal, for which I allow WebRequest? I.e. can the website e.g. see my other trades or EAs on the terminal? Thanks
Hello! I have below code: if (printHistory == true ) { handle = FileOpen ( "Ticks_" + Symbol () + filename + ".csv" , FILE_CSV | FILE_READ | FILE_WRITE , ',' ); if (handle < 0 ) { Print ( "Could Not Create/Open File " + IntegerToString ( GetLastError ()));
Hello all, I'm trying to run an optimization procedure to easily go through all my opening conditions, which are numerous, and check which combination of opening conditions are the best. For that I just used boolan inputs and added a additional conditions in buy/sell conditions as you can see in
When we manually set trailing stop, all we do is set it using the Terminal >> Trailing stops . Once we set, it does its job its own. I'm asking for function like that kind. As I know, The EA should check the conditions and move the SL based on every tick if I use PositionModify(); for trailing stop
Hello, Please could you tell me why my PC is crashing running this particular EA from which you have the code inserted below ? All others EA I tried run fine, there is a particular problem with this one, which has been generated using ChatGPT. Be careful if you run it in your computer as it surely
Hi I would like to know how to get the money value of 1 tick in MT5 I tried double tickSize = SymbolInfoDouble (symbolA, SYMBOL_TRADE_TICK_SIZE ); tickValue = SymbolInfoDouble (symbolA, SYMBOL_TRADE_TICK_VALUE ); But that does not gives the correct value The value I am after is the one used