MQL4 and MetaTrader 4 - page 5

To post a new topic, please log in or register
I am writing an MQL4 EA that I am frequently optimizing. Recently, the number of combinations are increasing exponentially. Soon my 16GB of RAM will no longer be sufficient, unless I want to wait months to optimize. I know MT5 has cloud CPU solutions, but I can't find anything for MT4. Can anyone
I have a large EA that works wonderfully on EURUSD 1 minute in virtual, in Mql4. My problem is that as soon as I get into reality, he loses money. I turned in all directions and I cannot correct the error. I think it should be fairly easy to fix. Thank you in advance for your help
Hey Guys i Just Tried To Cconvert an indicator From PineScript to Mql4 and i made this indicator but now i want to add some sideways market filter to it for more accurate signals i found some indicators called " Slope Direction " is there any way to tell this signal indicator to " Do Not Show Signal
Hi everyone, I'm new here, also this is my first day using MQL4. Is there a way to use MarketInfo MODE_STOPLEVEL to be the actual value of the min stop loss and take profit in the input and aftwards change the value based on user's input
There is no way to get to the point. I need to send orders asynchronously, I mean, I can't wait for a reply to be sent, to send another one, because I have more than one order to send at the same time (for two different pairs). How to send orders asynchronously with MQL4? Thanks
Hi Everyone. I have been using an indicator lately that I really like. Essentially the indicator Tracks Price Action and Volume and notifies you of trend changes. The only problem that I have is with the alerts. When it alerts you of a trend it literally states: "New Signal Current Trend Up" or "New
Hello there, i have a question: Maybe you know the super trend indicator. I want to use it for my StopLoss. But somehow this is crazy: When i ask for it´s value on the chart it looks very normal! It shows the normal price on the chart, that it should have. But when i ask in the code for the value...
// Exit orders, long trades if (MarketPosition == 1) { if (iBarShift(NULL, 0, OpenEntryTime) - 1 == 0) { LStop = OpenEntryPrice - MMFrL * MathAbs(iMA(NULL, 0, NMML1, 0, MODE_EMA, PRICE_LOW, 1) - iCustom(NULL, 0, "ZLTrend", PRICE_CLOSE, NMML2, 0, 1)); LStop =
  PSAR to closing trades (14   1 2)
Hi guys, I want to ask how to close order using a Parabolic SAR. I have two logic to close the price: 1. comparing the previous bar with the current bar. double sarPrev = iSAR ( NULL , 0 , 0.1 , 0.2 , 1 ); double sarCurr = iSAR ( NULL , 0 , 0.1 , 0.2 , 0 ); //then comparing with the price if
Hi guys, I've been messing around with the Camarilla Indicator and I wanted to get the main pivot values for my EA, can I use iCustom() for that? or should I just pass the code to the EA? but where exactly would I place it? I tried to place it on the onTick() but with a condition of only calculating
Hi everyone, I am trying to show arrow once the bearish pattern is found but my code is not giving me any error nor even it is showing anything on chart. Please read the below code and your help is very much appreciated. Many thanks
I want to copy an EA, change it and make another fairly similar EA. The EA uses an .mqh include. I open the include in Meta Editor. I press F7 (compile). No errors. I drag and copy it with another name. I open it in Meta Editor. I make NO CHANGES to it. No change whatsoever. It is an exact copy of
Hi Guys, Could anyone help, i can't seem to correctly balance the parentheses. Any help would be appreciated. thanks Tim int SmallSMA = 5 ; int BigSMA = 15 ; int BuyOrderNumber; int SellOrderNumber; #define MAGICSMA 202006 extern double TakeProfit = 500 ; extern double Lots = 0.01 ; extern double
Hi guys, I have an issue with my EA where it works fine on the back test, but goes completely berserk on the live. What happens is when I back test, the EA places a total of 269 trades right? With a win rate of just over 60%. But when I released the beast into the lives, it placed more than 40
hi i have the a custom indicator that shows some arrow and line some of them suppose be delete but they are there as i open the custom indicator setting and close it without any change in the input the chart goes to normal and unwanted object deleted how i can prevent that
I am trying to do something along the lines of: If( *variable changes* ){ Buy=true; } I am pretty sure this would involve some type of loop, but I cannot seem to get it to work without doing something more complicated that involves multiple variables. Is there a simple way to do this
I have a leader-board style indicator that shows the most profitable comments from order history. The problem is if there's a tie it overwrites one of the values instead of showing both tied comments in order. This is how it looks normally. This is after I tried to fix it. int OnCalculate ( const
Hi everyone I modified MT4's official DMI+ADX indicator( ) to make it same as other other platforms. The change is, MT4 calculates the EMA of (±DM/TrueRange) for ±DI while my version is to calculate EMA of ±DM and TrueRange separately then divide them. The ADX part
Hello Everyone. Please can anyone help to add sound and notification alert to this indicator...really would appreciate it
Hi, I would like to add a sound alert to this mq4 indicator(it seems very simple to get it done but I am really not good at even the basic coding), is there anyone who could help me, please? thanks in advance! yours, shunfengcn
  Need help with coding (135   1 2 3 4 5 ... 13 14)
Hi i am trying to code a very simple EA but i'm not a programmer and i've never made an EA before. I took the MACD Sample from MT4 and edited some parts and deleted all the rest that i thought i don't need. I'm sure my code is really horrible I would like the EA to work like this: My custom...
Hi Coders! I'm looking for a little number to string function. I have a number, for example: 344256454.23 and I would like to print it in this form: 344,256,454.23 Is it possible with bult-in function? Or I have to write this function? Thank you. Relative
Hi All, Hopefully, someone can help me with the below. I want to check if a condition remains true for a given number of bars. Specifically, I want a MA to keep growing for at least 10 bars, after having crossed a slower MA. If the condition is not met, I want the FOR loop to restart from 0. This is
I have read and tried every forum post about refreshing/updating charts on new bar.  I can't get any of them to work, even those that seem to be working for others.  For example the following two versions of the same one, both placed within start().  What am I doing wrong?!  Edit:  I also tried it...
Is technical support for the MT4 trading platform available if I have a problem with it? If so, where? If not, what is the alternative
hi guys i have this script //+------------------------------------------------------------------+ //| | //| | //| |
Dear All, I trying to write a code to Trail Stop Loss. ///////////////////////////////Trailing Stoploss////////////////////////////////////////////////// if ( OrdersTotal () >= 1 && startModify) { if ( OrderSelect ( 0 ,SELECT_BY_POS,MODE_TRADES)) { double currentPrice = 0 ;
Hi everyone, very new to mql4. Hope someone here can help me out. I want to create an ea that measure the highest and lowest price within a specific time period every single day. For example from 8am to 12:00. I want to use the high and the low within this period to set pending buy/sell-stop orders
Hi all, I have several charts open, each with the same Expert Advisor. I am having trouble running 5 of them simultaneously. For example, when I close a EURUSD chart , another trade takes place from the same ea but on a different chart say the CADJPY. Its as if the ea system is running them one
Hello all, if(id==CHARTEVENT_KEYDOWN) { if (CharToStr(lparam)=="1") {--- I made this way and it works, how can I catch a "11" per example? Thank you