MQL4 and MetaTrader 4 - page 145

when i compile i have zero errors but when i run the ea i see this sometimes pop up 2022.04.28 15:27:22.012 RoyalPrinceDash AUDCAD,H1: zero divide in 'RoyalPrinceDash.mq4' (1186,107) and in Metaeditor Debugger it highlights this section of code. i will post it below. void PlotSpreadPips() {
I have an Edit object. After I type a value in it, I want this Edit object to be deleted (i.e. when I press the Enter or anything else or click the mouse to finish the editing, I need the Edit to be deleted). Is it possible to detect in MQL (without using WinAPI) if the Edit lost the focus
Hello guys, I've been on a demo account since Jan 13, being mentored by my uncle. I had a big loss, showed my uncle the screen shot and he stated his chart looked different compared to mine. He called me, told me to take a screenshot at the same time as him to see the difference. We live in the same
Is there anyone knows the meaning of the color of those cells in the P/L column in Trade window in Metatrader4? Why some are red, some are not. Thank you for your help. - Clearpicks
hi everyone, i used a bot(ea) in mt4, but forgot name of it, when i do EUR/USD parity it was written " EURUSDb " maybe u remember from this clue
in Mt5, I can use OrderSendAsync() function to run quicker, is there any way to do so in MT4? and OrderCloseByAsync()
Hello, I want to read the price from the trend line object. I just want to get the price (upper and lower line ) on the current bar. for ( int k= 0 ;k< ObjectsTotal ( 0 , 0 , OBJ_TREND );k++) { string name = ObjectName ( 0 , k, 0 , OBJ_TREND ); if
Hi, how can I skip trade int= 0 if not exists. Also problem is if I have more different symbols: EURUSD, GBPUSD EURUSD: count = 2 GBPUSD: count = 1 int myCount() { int counts= 0 ; for ( int i= OrdersTotal ()- 1 ; i>= 0 ; i--) { if ( OrderSelect (i,SELECT_BY_POS,MODE_TRADES))
The app won't let me enter any lot sizes less than 1. It allows the input, when the trade goes through it has changed to 1 full lot. On the same account in MT4 desktop I can use whatever lot size I want
Hi, I want only update Count: If I have 1, to 2 and other string I don't want to change... this is my code: void SaveInfoForSymbols( int ticketId, int orderType, int count) { string sym = "data//" + _Symbol + "_info_" + ( string )MagicNumber + ".txt" ; int
Hello everyone! I am making an indicator to know with a rectangle how far the Sop Loss reaches for my configuration, the problem is that I have already made the indicator at 80% but I cannot find a way to give the second point, the premises that I set is that the starting point must
I want to create a indicator which can grab opening & closing price of every session & also some custom time Need help with that coding.. Can anyone help
Hi guys. I know how to configure and code that emails be sent from an expert advisor to my mail. But I do not know how to configure and code that my expert advisor receive mails from me. This is necessary to remotely control your EA's behavior. For example, you may want to send a certail number or
Hi, I want to make an EA with a strategy like the following. Lets say I have a sell order . If the price then drops by xxx pips, it will open another order like averaging. And if the price continues to fall it will open the next order. Etc. I made the following script, is there something wrong, why
I trully need help from anyone that can help change this file and I have been looking for this fo YEARS no lie its been an obssession ever since 2 years ago...... Now i finnaly have it but its not as a mt5 q file....Please help change this file to Mq5 You can have it as well... God Bless <*.ex* file
[Deleted]
How would I make an alert only occur once per current bar and reset for the next bar? ty
Hello Everyone, I am traying to create my own library and referring to it from my EA code under MQL4\Libraries I have my amrBungees.mq4 and the ex4 which include my functions under \MQL4\Include I have amrBungees.mqh #import "amrBungees.ex4" short yellowBungee(); short greenBungee(); short
hi there i wanted to know how can i handle market execution using mql4 for eg i have an order open with 0.1 lot and i want to execute the order with 0.05 how can i do that with mql4 code. thanks
Hi, All of a sudden my MT4 app on my phone stopped sending me push notifications so I re-installed it. Since then I cant access my MQID number as it keeps sending me to OTP authorization, then 'bind to an account'; but nothing happens. Can anyone help, im getting very stressed as I need my
I'm trying to add a standard moving average indicator ( iMA() ) to the price chart of an EA. I've googled quite a bit but all I've found explained is how to add a custom MA to a price chart. Does a simple 1-line command exist which allows me to add a standard MA to a price chart or do I have to go
As you might know, whenever you call something like CopyRates or iHigh on a Symbol that doesn't have an open chart set to that Period, you will either get old data or an error value. However, MT4 will update the history data for that Symbol + Period and it can be accessed shortly thereafter. My
[Deleted]
Hi, I have been trying to fix this several times but I just can't find where it's dividing by zero. Can someone be kind enough to look into this??   //+------------------------------------------------------------------+//|                          spiders101.Pro_Bot_EURUSD_m15.EA.V1.mq4...
Hi everyone! I have one problem, in mq4 code, I make indicator, this is Fractal component system. And I use IndicatorCounted() in Start function: int start() { int i=0, j=0; cbars = IndicatorCounted()/25; //cbars = WindowFirstVisibleBar()/25; if(cbars<0) return(-1); if(cbars>0) cbars--;
Hi, I have an EA that is structured like this: The main mq4 is holding an array with 2 class objects called 'Side', one for buy and one for sell. Measuring the execution time of the Side method that contains the logic takes 2microseconds. Measuring the same method from outside the class it takes
Alright, I started a new thread because it's a different topic. My EA uses an indicator to determine a bias toward long or short. When the bias changes it fires the order function. This is the only place that the order function is called in my code. However, I have found that several times the order
Hi all, I'm trying to generate the current open trade type but with the following code but the result is always 0 even when the current trade is a SELL. I've adapted the same function to collect the last (history) type trade and it worked fine. For this function i've changed the OrdersTotal for
Hello, First return 0 and then return 2 int CountTrades() { int icnt, itotal, retval; retval= 0 ; itotal= OrdersTotal (); for (icnt= 0 ;icnt<itotal;icnt++) // for loop { OrderSelect (icnt, SELECT_BY_POS, MODE_TRADES); // check for opened position, symbol & MagicNumber if
Hi, I've recently encountered unexpected results when testing my EA on MT4's Strategy Tester . After a little investigation, I've suspected that OnTick() function does not actually get called on every tick, So I've created a new, very simple 'EA'. The only thing in this EA is this line of code under
Hi, everyone. I am new to MQL and just wrote my first EA as shown below(just a tester).Since I want to record all my open trades information( Open Trades ONLY), I tried using FileWrite Function to record it and export it to CSV.The problem I am having is that, when I run it through Strategy test, it...