MQL4 and MetaTrader 4 - page 68

I have tested simple code below and i got Array Out of Range Error. #property strict void OnTick () { Test(); } void Test() { double a[ 500 ]; Print (a[ 10 ]); ArraySetAsSeries (a, true ); double ma = iMAOnArray(a, 0 , 10 , 0 , MODE_EMA , 1 ); } but when i add one variable in
Hi, recently made a EA with MQL5 iam now recoding it for mql4. Function returns a simple JWT token. I have updated the "WebRequest for listed url" with the url on both. Any ideas? Thanks. CJAVal Login(CJAVal &dataobj) { CJAVal json; string url= "http://127.0.0.1:5000/loginExtension" ; char
  Send Error 131  (1)
I was getting a send error 138 while I was testing my EA. Got the info as to what it was and how to fix it, and did. Now I'm running my EA Live on a VPS and now I'm getting a Send Error 131. Can someone tell me what it means and how to fix it
[Deleted]
Hello everyone, I'm recreating a MACD (I know there's dedicated function, just wanted to calcualte by myself) and when I calculate the signal line it makes my platform freeze for a bit, everytime I change signal line period I get a 10sec lag of the platofm. Someone can help point out why that
Hi all, I'm new with MQL4 and I have this indicator which I should embed inside an EA. I know I could use the iCustom function but for several reasons I have to embed the code right inside an EA function. Could you give me some suggestions to avoid modifying whole indicator code? Also some simple
  OnTimer()  (6)
Hello! If I place a Market order on OnTimer(), Market is open But there is no tick coming in that moment , order will still be sent? Let’s say I want an order to be send if TimeLocal() >=some_datetime. Last tick was received 15 seconds before some_datetime. This order will be sent? I want to use
Theres only 2 errors and i cant seem to fix it, ';' - unexpected end of program (line 80) '{' - unbalanced parentheses (line 31) double entry_price = NormalizeDouble(price, MarketInfo(Symbol(), MODE_DIGITS)); double sl_price = NormalizeDouble(price + StopLoss * MarketInfo(Symbol()
  Error code 130  (3)
I'm trading BTCUSDT which has a minimum stop loss of 50 pips. My stop loss is roughly $5 away (0.02%) for every trade. Only about 10% of the trades actually go through, and every time it throws an error I print the price, SL and TP. All the calculations are correct and exactly the same when it goes
Hello, I faced a strange error. I'm using ontime function based EAs and recently some EAs stopped with message "cannot set timer (xxx)". As you know, ontimer function requires 'EventSetTimer(xxx) to run the function repeatively. Have you guys ever met this kinds of error? Thank you for your feedback...
Good Evening, I've a problem with my customized indicator. That is, when I go to emulate it on multiple crosses and let it work for hours without closing the windows, this indicator continues to vary from cross to cross. which should remain the same because it has to calculate the same series. What
hello all ,, can u help me to modify my code ?... i wanna build strategy like this https://telegra.ph/file/fbdc32ed144011a1c8c0a.jpg with Fxgen and the model is like this https://telegra.ph/file/10ac5ab589d8a46a05554.jpg as u can see the model is not simple ... if the order reach Buyorder5 and
Hi there, I'd be very grateful if any programmer out there could have a look at my code? It compiles with zero errors but when I install it in MT4 Strategy Tester it generates zero trades... What have a missed out? Its just a simple MA crossover strategy using the RSI and Stochastic indicators as
Mt4 on my Samsung stopped displaying charts. No error message just a static image of three candles in monochrome appear. Screenshot attached. No indication that a chart is even trying to display. Everything else in the app works fine. App was updated, same result. Same if symbol is changed. Any
  Error Msg 138  (3)
When running my EA on MT4 Demo account, it seems to only trade in one direction when backtesting. In the journal it shows the Buys and Sells, but the Sells show an error 138. What does this mean and how do I fix it
[Deleted]
The documentation for print (https://docs.mql4.com/common/print) says: "It enters a message in the Expert Advisor log." Where can I find this log?
I have a calculation for finding the Price from MA100 and MA50 shown in the formula below. How do i, 1; find all the price points where this has happened so that i can indicate on screen and 2; if MA100-MA50, how do i rank the last three prices from the subtracted difference? for ( int i = 0 ; i
Is there a near universal method to convert price difference between open and close of any symbol bar to pips . One that works with even exotic pairs and indices . Is it even possible ? I am currently using the follwing code for the purpose . It works great for most of symbols from the marketwatch
In this code there are 2 buy conditions, but i just want to open 1 deal every one condition to be the total deals are unlimited, but every buy condition is equal to just 1 deal extern int MagicNumber= 10005 ; extern double Lots = 0.1 ; extern double StopLoss= 0 ; extern double TakeProfit= 20 ;
Does MT4 have a "VOLD" indictor available
Hi all, I want to open a broker in my region. I want to build a MT4 server for testing first so I like cheap service. Anyone know about this, please kindly share. Thank you
I am new to Forex trading and I know next to nothing about MQL4 coding but I would like to get this code working. I will appreciate your help. The errors from the MQL4 program are: 1. 'close' - invalid array access 2. 'ticket' - variable already defined. I have made the lines the errors refer to
  How to get backtesting faster ?  (33   1 2 3 4)
Need help to run backtesting using MT4 faster, What do I need for doing it ?
The new released version of the mobile trading platform MetaTrader 4 Android has fixed issues found in the previous versions and features the Crosshair mode. The updated application now allows users to easily view the date, price and indicator value at any chart point selected. This makes for more...
[Deleted]
High[0] Low[0] Close[0] all return the open value of the bar... am I missing something here? Doesn't make sense why if I do the following: Print("Open = ", Open[0]); Print("High = ", High[0]); Print("Low = ", Low[0]); Print("Close = ", Close[0]); They...
{ // Get the current fast and slow moving averages double fastMA = iMA ( _Symbol , 0 , FastMA, 0 , MODE_SMA , PRICE_CLOSE , 0 ); double slowMA = iMA ( _Symbol , 0 , SlowMA, 0 , MODE_SMA , PRICE_CLOSE , 0 ); // Determine the trade type based on the moving averages if (fastMA >
I'm Italian but I need an mt4 terminal in English to be able to make video explanations to my customers, I just don't understand how I can change the language of the platform. Can you help me
// Declare global variables extern double LotSize = 0.01 ; // initial lot size double MaxLotSize = 0.05 ; // maximum lot size double MinLotSize = 0.01 ; // minimum lot size double RiskPercentage = 2.0 ; // risk percentage per trade double TakeProfit = 0.0 ; // take profit level double StopLoss =
  This week profit  (6)
//This Week Profit int WeekTime= iTime ( NULL , PERIOD_W1 , 0 ); int WeekTimeLast= iTime ( NULL , PERIOD_W1 , 1 ); double ProfitWeek= 0 ; int WeekTrades= 0 ; for ( int z=(OrdersHistoryTotal()- 1 ); z>= 0 ; z--) { if ( OrderSelect (z
Hi, After updating/installing the latest MT4 Android Build 1357 yesterday (09MAR2023) from Google Play Store, my MT4 Android app didn't work anymore (the phone just didn't wanna load the app), so I had to uninstall my MT4 Android app and download/install the latest Android Build 1357 again. However