MQL4 and MetaTrader 4 - page 160

  Problem with ZigZag indicator  (36   1 2 3 4)
Hello, I'm trying to develop an expert that digs the historical data (peak and bottoms) to be used for my main expert. I decided to use zigzag indicator since it's simple and finds the high/low easily. My problem is, when I call the ZigZag.ex4 using iCustom() function I cannot get the correct high
Hello, I am coding an EA which is supposed to open trades only if my indicator draw an arrow but sometimes it opens order without any arrow. Do you have an idea of this kind of issue? Thank you
Hello, I need to use the number of testing days within an ea (basically test end date - test start date) How can I get it ? Thank you
I was hoping someone might help me In the case whereby the (iHigh) and (iLow) in MQL4 finds the highest or the lowest price of a single candle, Is there a way or function i can use to find a common low or high price shared by a set number of previous candles and use the returned values to draw a
int OnInit () { //--- indicator buffers mapping SetIndexBuffer ( 0 ,SlopeBuffer); SetIndexBuffer ( 1 ,SMABuffer); //--- return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Custom indicator iteration function |
  MT4 Profit Bug  (1)
HI guys, im testing an EA on my broker MT4, but i found out the result is abit strange, because the result is showing profit but when i look at the total amount of profit at below, it only shows a few dollars. Im not sure why, my broker is FBS Zero account with 1,000 USD and 1:500 Leverage, Its not
hi sir have an EA that creates horizontal lines and create a button when initiated. If the button is pressed an order will open and all the horizontal line that have created upon inititating the EA will be deleted buy ObjectDelete. For example i pressed the button on 1 min TF it do its job making an
Pleasant Day to everyone. I've been working on an indicator that shows when the current trend is at a Higher-High, Lower High, Lower-Low or Higher Low position. Indicated as HH or LH Text Above the Candles in Green and LL or HL Text Below the Candles in RED. The problem I'm having is that the text
The CCIMA EA uses Commodity Channel Index and Moving Average to enter the trade. The CCIMA EA can use to trade all kind of Forex, Indices, Commodity, Metal and Crypto Currencies inside the MT4 platform. Overview Trade direction based on MA trend up and down and CCI breakout from base level -100 and
  Uninit reason  (1)
Hi guys، I ruined my expert on my pc it works well, but I run it on VPS server it don't work, it gave me errors like uninnit reason 3,5. What I should to do
Can anyone help to resolve this is there a place where you can check the fault codes
[Deleted]
Is there another way to derive the body of the candle, rather then using moving average. double AvgBody( int ind) { double candle_body= 0 ; ///--- calculate the averaged size of the candle's body for ( int i=ind; i<ind+m_ma_period; i++) { candle_body+= MathAbs (Open[i]-Close[i]); }
Calling the system gui library and creating a simple dialog program initializes fine on mt4, but once the chart cycle is switched several times, it will be wrong, while on mt5 there is no such problem, everything is fine The code and images are in the attachment
  MT4 Backtest Bug  (4)
Hi guys, since yesterday my MT4 Strategy tester is becoming very strange... All the EA the i use for backtest will result like this. All price open at far from where it should be...Even using the MT4 original EA Moving Average, it also showing that, the buy price opens at super high then close at
HI together! I want to write eg the spread in a csv file line by line for different times (eg every 10 min), but cannot set the pointer to the correct line (= the next free line). It always writes the data into the same line. nevertheless i can read an open the file with notepad or Excel. But I...
I have a workspace with 4 charts that are set to sync on the same symbol. The purpose for this is to perform a different analysis for multiple time frames under the same symbol. For this to work, each chart in the workspace needs to share the same symbol, and be configured to use a separate account
  how Sleep() use?  (18   1 2)
hi, i do Sleep() in EA, why no useful? somebars=(Period()*60*1000); OrderSend(Symbol(),OP_SELL,LotsOptimized,Bid,3,0,0,"",MAGICMA,0,Blue); Sleep(somebars); Print(TimeCurrent()); but----------------------- 23:49:48 2005.02.04 10:24 ϵͳ1-3-7 EURAUD ,H1: open #7 sell 0.10 EURAUD at 1.68435 ok 23:49:48
Hello, I have a trendline on my chart which basically shows the trend of price and I have a horizontal line which stands for support or resistance. I want to calculate the  intersection of the trendline and the horizontal line Is there any way to do this with MT4?
  Obj_Hline Price  (3)
Hi guys I have a code the create horizonal line on chart, my problem is how can I get the price of where my horizontal line is located and save it to a variable, if I drag the HLine up or down the variable where the price is saved will updated. thank you
  For Loop & Array problem  (17   1 2)
Hi all, I would like to open my trades when a certain amount of figures is reached so that the EA can open x amount of trades. So for example: 2 figures 1 trade, 5 figures 2 trades, 7 figures 4 trades. I know there's is a way as i have tried using the following: for (a;a< 1 ;a++) for (a2;a2< 2
Does anyone know of a 3rd party that offers software/tick data for testing EAs? I'd love to have a second opinion. I have two brokers already that I run against but I'd like more data! I thought I remember running across something like this before I knew how to code MQL at all, but I cannot find it...
Error! Invalid file type uploaded, Grace.ex4 - Script. Your product's category is Experts, correct program type for it is Expert Advisor why say my EA is a script thanks
  For loop, array & timeframe  (12   1 2)
Hi guys, don't know if I know what I'm doing, are either lines of code correct? int TimeFrame[ 3 ] = { 15 , 60 , 240 }; for (i= 0 ; i< ArraySize (TimeFrame); i++) { if (TimeFrame[i]== 15 ) { return (i); } if else (TimeFrame[i]== 60 ) { return
for Example: I will buy 0.07 lot EURGBP at 0.8040, and the SL = 0.8000 I want the mql4 code : to calculate when hit SL , the losing usd amount is ? anyone can help? THANKS
203 for Example: I decide to use $28usd to be Initial margin for selling EURGBP ? if mt4 acc. leverage = 500 I want the mql4 code : to calculate the lot =? lot anyone can help? THANKS
Hello. There are incorrect information about ObjectMove() in MQL4 Reference (MetaEditor Help). T wo variants, but one duplicated description. https://docs.mql4.com/objects/objectmove
Implicit string to number conversion warning occurs next to all values in the array. Don't understand why considering each value returns a double. How can input the values for RSI240P0, RSI240P1, RSI240P2 in the array without getting that warning? double RSI240P0 = iRSI ( NULL , PERIOD_H4
int CheckBuyOrdersinLoss() { int op; { for (i= 0 ; i< OrdersTotal (); i++) { if ( OrderSelect (i,SELECT_BY_POS,MODE_TRADES)) if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicID) // if (OrderType()==OP_BUY ) {
[Deleted]
Hello, i had find out with the help of a Moderator that in the Strategy Tester the function OnChartEvent() does not work, i wanted to ask if somebody knows a trick or solution how i can get the chart event also in a Strategy backtest.
  Global variable warning  (15   1 2)
I am getting the warning "declaration of 'SLPrice' hides global variable". (When I click on the error it takes me to where I've added ***). Pretty sure this warning leads to another one as I input my stop loss as "stopLossPrice(SLPrice)". The subsequent warning is as follows: "implicit conversion