MQL4 and MetaTrader 4 - page 672

Dear all, How to modify the code to show only the bottoms of the zigzag ? The following code below can successfully extract the tops extracted by zigzag indicator.tops[] has been specified as the index buffer in the init() function ....But is it possible to only show the bottoms of lower turn point
We are in m1 timeframe, in the current bar meaning index=0. How can we get the index of the first bar avaiable of the data? Thank you.
Hello Im programming an EA that analizes the 300 bars prior to the current bar. So If I try to backtest in the begginning of my data I get the "array out of range" because the bars. How I should handle this one? I mean I want the code to analize if there is enough bars to run the EA in the backtest...
  iHigh & iLow  (1)
Do these 'i' functions disregard spreads or include them?
I have a strange thing happening which I cannot figure out. If I run the following code for (i=1; i<=bars; i++) {   closePrice = iClose(NULL,timeFrame,i);   openPrice = iOpen(NULL,timeFrame,i);   if (closePrice > openPrice)   change = change + (closePrice - openPrice);   else   change =...
[Deleted]
struct market{      double minqty, stepqty, pl, bid, ask;   int spread, minsl;   string ticker;      market(){      minqty = SymbolInfoDouble(ticker,SYMBOL_VOLUME_MIN);      stepqty = SymbolInfoDouble(ticker,SYMBOL_VOLUME_STEP);       pl = AccountInfoDouble(ACCOUNT_PROFIT);       ticker =...
[Deleted]
Hi, I am trying to setup the notification function for my MT4.  However, i can't seem to be able to find my Metaquote ID on the iPad version. Appreciate any help i can get.   Many Thanks.
I m running MT4 on Windows 7 and all of none of the pre-installed indicators are working. They all have the gray diamond on their icon. The HELP section of MT4 said this about the gray diamond on the icon.... "If the diamond in the lower right corner of a program icon is gray (for example, ), it...
  Double to DateTime  (10)
...Set_D1_Bar = GlobalVariableSet("D1_Bar",iTime(NULL,1440,1));D1_Bar     = GlobalVariableGet("D1_Bar");D1_Bias    = "Bearish";Comment("D1 Bias is: "+D1_Bias+" since: "+DoubleToStr(D1_Bar,TIME_DATE|TIME_MINUTES),        "\nH4 Bias is: "+H4_Bias,        "\nH1 Bias is: ",H1_Bias);... How is it I can...
[Deleted]
Hello forum, good day. What is the best way to check for the average of %K and %D of the Stochastic indicator? I need to evaluate if (%K + %D) / 2 >= n. Would it be using iStochastic() with iMAOnArray()? Best regards and thank you in advance, codeMolecules 
Hello there. Im using some moving averages values for the TP of my EA. Unfortunatly always at the end of the backtesting the MA that Im using shows (its drawn at the end of it) Is there anyway to make that NOT happen. Thank you.
[Deleted]
Hello forum, good day. I started learning MQL5 before MQL4 and I'm having a bit of trouble translating an EA to MQL4. Here is where I'm stuck: MQL5 code: void OnTick () { int total = 0 ; for ( int i = 0 ; i < PositionsTotal (); i++ ) { if ( Symbol () == PositionGetSymbol
Hello!! I have some problems with the value chart indicator in MT4 it works on all time frames except 1 minute where it does not plot. Also it works on some currency pairs but not not on others. Do any of you have any help to fix the problem?
I think it would be a nice idea to synergize our development as developers :D Contact me if you are interested. Thank you
  EventSetTimer()  (14   1 2)
If I use the EventSetTimer() function in an EA will I be able to test it in the Strategy Tester? (I know e.g. that the Sleep() function does not work in the Tester)
I found some auto trading options on meta trader 4. It has each other names.    1. Toolbar : AutoTrading (button) 2. Expert Advisors tab in Options menu : Allow automated trading (checkbox) 3. Common tab on Chart Expert Advisors properties (on popup menu when mouse right click in chart) : Allow...
Hello again, sounds simple but it didn't work: 1) class A has a public-function and it's body - working ! 2) class B derives class A, function of class A is directly available and working ! 3) in my indicator is a instance of class B, the public function of Class A is visible again, tells me its...
I want to achieve this purpose: when the EA was attached into some pair's chart, and some case happened, then a message box or relative thins will be showed, and a certain sound, such as "alert.wav", will play again and continuous until I click the OK button on the message box. does it can be...
  Limit Pair To 1 Open Order  (11   1 2)
This code works in back testing and most of the time forward testing but every now and then an extra trade will still be placed on the currency pair despite the check in the code below that SHOULD be preventing this. Trades do have different magic number but I do NOT reference them here as I only...
Hi there,  I would like to ask why Close values are not same for different time frames. I have bars from PERIOD_M1 and PERIOD_M5 with same datetime but with different Close values. Example: 2015.03.03 17:34:01.437 USDCAD,M5: 2015.03.03 17:40:00 | 2015.03.03 17:40:00        1.24416 | 1.24432015.03.03...
[Deleted]
Hi, I would like to code an indicateur wich mark +1 each time that a price is crossed. example : if price hit 3 times 9600, indicator will mark "9600  +3". My first idea was : double ask    = Marketinfo(Symbol(),MODE_ASK);double bid    = Marketinfo(Symbol(),MODE_BID);double price  =...
[Deleted]
Hi, İs there a ready made script or EA for One Cancel All ( OCA) type operation for pending orders ? Or should I have it coded for my own use ? Thanks in advance...
  accurate historical data  (11   1 2)
I had been speaking to FXCM regarding historical data. I already had downloaded free historical data from MetaQuotes and the support person sent me a link where I could purchase 10 years of historical data from FXCM. The price was $500 which did not make sense because I had free data from...
[Deleted]
Hello forum, good day. I'm still relatively new to MQL/MetaTrader and have an EA that would like to use in MT4/MT5 with a real account. What I would like to do is to start trading with it, how is this possible? Best regards and thank you in advance, codeMolecules 
Hello everyone, I come from Ninja Trader platform. There you could have a list of pairs, click on one and populate charts with the pairs. Done via color associating each window. I can't figure how to do the same thing with MT4?! Using: OANDA - MeraTrader v: 4.00 B 765 Thanks for any help.
Hi Guys, I have a Expert Advisor with Sendmail function and it's working correctly when I open a new trade. the problem is: when my Stop Loss or Take Profit is reached, I do not get a Sendmail notification. Is there anybody who can help me with this problem? I search all of the internet, but could...
hello everyone, I'm working on an ExpertAdvisor to Alert me if some special case appears on the chart and I tried the functions Print, Alert, SendNotification, but non of them works.       I'm fully aware that these 3 functions are not equivalent. Alert gives an Alert in a separate window. Print...
New article Bi-Directional Trading and Hedging of Positions in MetaTrader 5 Using the HedgeTerminal Panel, Part 1 has been published at mql5.com: This article describes a new approach to hedging of positions and draws the line in the debates between users of MetaTrader 4 and MetaTrader 5 about this...
Hello Dear Community, does somebody know how Ican solve the problem with the "Locking" of the Cbutton? I havecreated a CButton on a chart with the following code. I would like to havea button which youcan press, but the button should not have two states (like it is actually inmy code, the button has...
Here is the URL address that it takes me to when I click on the Code Base or click on an EA or Indicator. https://www.mql5.com/en/code/11649?utm_campaign=MetaTrader+4+Terminal&utm_medium=special&utm_source=mt4terminal+codebase Here is the the text on a white screen that comes up. NOTE: IT SOMETIMES...