MQL4 and MetaTrader 4 - page 164

In MQL4, we're taught (for example) to use Time to access the array of datetimes for bars in the current period, and iTime to access the time of a bar for periods other than the one the user is currently looking at. However, in MQL5, there is no Time array, so we're forced to use iTime. This creates
Options > Charts setting are not applied, and neither is the default template
I found that MT4 can read files with FileOpen only in Files folder in MT4 terminal. Is that true? Is there any way to read files in another folder ? int FileOpen ( string filename, int mode, int delimiter=’;’)
I have no idea what i should do to fix this can someone help me out a little with my code and explain where and how i messed up it kind of work when i'm testing it but it's not working on every trade this is the code PLEASE HELP going on 2 days i've been looking into this issue int TrailingStop=
What I want to do is to create a trendline with angle based on 2 anchor points and then find the angle using ObjectGetDouble() so it can help me do various trading tasks such as finding chart patterns. See the code below : // OnTick() event handler                void OnInit() {     // Finding 1st...
Hi, when im using the code below to return the Print, it doesnt work. when i change the code from "<" to ">" it seems to work however. Not sure why "<" doesnt work though. Any advice would be appreciated. #property copyright "Copyright 2021, MetaQuotes Software Corp." #property link
Hello, i'm new to Mql4 and although i have managed to create some basic algorithms for EAs, i am struggling with creating a particular EA for one of the strategies that i have been using for a couple months. You can find the basis of the strategy in this video: 86% Win Rate Highly Profitable Secret
  XOR in mql4  (13   1 2)
I really cant find it in reference... Is there XOR?
Hello, I'm having a problem with the shift parameter for the iMACD and iStochastic functions. I wrote a piece of code that is run at the first tick of every hour: this condition is verified by reading the current Hour() and checking if it's > than the Hour() value saved in a static variable during
I am creating an EA where it checks the Close[0] to either buy/close/sell. My question is because bar 0 is not fully formed yet, is the Close[0] considered as the ask/bid? Or is it only considered a Close once the bar has completed. I need to know because if it is only considered a close once the
Good day. I have this Code in my EA that uses SymbolName(index,true); and I am getting data that doesnt represent my market watch. I created a Script that uses SymbolsTotal(true) and also i get inconsistent data. Thjis is What I am getting and this is my Script
  renko
i downloaded renko to my mt4 and when It is installed it is offline? Can anyone help
[Deleted]
I am more comfortable working with dark color bars on a white background. If I right-click on a chart and click "Properties", I have the option of changing to a different color scheme (in my case I prefer "Black on White"). However, I find myself having to do this for every new chart window that I...
I want to detect the current order was closed and total order is decreased. static int intOrdersTotalCurrent = OrdersTotal (); int intOrdersTotalPrevious = intOrdersTotalCurrent; intOrdersTotalCurrent = OrdersTotal (); if ( intOrdersTotalCurrent < intOrdersTotalPrevious ) { //
I have 4 errors and 2 warnings in my code need help with it big time been looking at this for a few days now and i cant come up with the solution PLEASE HELP! errors are 'while' - semicolon expected, '&&' - operand expected, ')' - unexpected token, and lastly 'else' - illegal 'else' without matching
while ((MovingAverageValue200 > PriceAction[i])&& (PriceAction[ 1 ] Close[ 1 ] <= PriceAction[ 2 ]Open[ 2 ] && PriceAction[ 1 ] Open[ 1 ] > PriceAction[ 2 ] Close[ 2 ] && PriceAction[ 1 ] Vol < PriceAction[ 2 ] Vol)); { //sell order = OrderSend ( NULL , OP_SELL, 0.01 , PriceAction[
How to Download free Indicator from the MT4 website list of indicators?? and How to instal it on Metrader MT4 platform? Please help, thank you
I'm trying to wrap my head around how to code the worse Fall (or Rise) of a Price within a Single Day (or Week); and the Maximum Retracement associated with that period. Also, along with the worse fall, I'd like to know what's the average retracement on a Daily (or Weekly) Instrument. I'd like the...
  Last trade profit/loss?  (11   1 2)
Hello, Is there any other way to see whether our last EA trade is profit or loss other than : string last;for(int i=OrdersHistoryTotal()-1,i>=0,i--) { OrderSelect(OrdersHistoryTotal()-1, Select_by_pos,MODE_HISTORY); if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic) { //for buy...
I want to write a code for an expert I want him to stop trading after 3 losing trades or after 3 winning trades
Hi, here is my code for which I have this problem, but I don't understand why you give me this in the end which in a nutshell only fits me long and not short if (currBars != Bars >Nearest_Up_Level && Nearest_Up_Level && checkMA( 0 ) && isAvailableOrder()) { double lot =
Hello All, Let me ask, I'm a newer in MQL4 and learnig to write EA with 2MA crossover. The result is that both Buy and Sell orders are issued. How to solve it, only buy or sell? Buy when MA1>MA2 and Sell when MA1<MA2. Thanks in advance. Kiae
Hi programmers, Hope you are having good days. I have a problem which I can not find my mistake, could you please point me the problem with this? It would be greatly appreciated if you give me a hand. #include "TicksInfo.mqh" CTicksInfo ticksInfo; input string AllPairsStr = "EURUSD,GBPUSD,NZDUSD" ;
Looking for feedback on this code. As of right now it complies but it doesn't execute trades in the strategy tester. Any help is much appreciated double SARValue; double SimpleEma; double Candle; double Candle2; void OnTick () { if (( OrdersTotal ()== 0 ) && (SARValue > Bid) &&(Candle <
HI, I need your help. I draw the horizontal Line on the chart by manual. And I want the EA to read the value (price) But when I draw it by manual, object name has some numbers. --> 38987 What is this number? TO read the price of the line, I want to use double Price =ObjectGetValueByShift(
  Metatrader 4  (4)
Is it still possible to download MT4 for Windows - the link I found on this site https://www.metatrader4.com/en/download said it was downloading MT4 but downloaded MT5 instead. Some signal providers only operate through MT4 so need that version. Thanks
Is there a possibility to set a pointer to the function as a class method (not a static method)? This example is without problems but only with a static method: typedef void(*TAction)();class Foo {private: TAction m_Action;public: Foo(void) {m_Action=Bar;} static void Bar() {printf("Function
Hi! I saw this indicator(ZIGZAG on fractals, without redrawing the values - https://www.mql5.com/en/code/10022 ) and I would like to get the last 2 values for an EA. The solution that I found only return one value for both cases (2147483647) using iCustom. this number means no fractal if we got
Thank you in advance for your feedback and help! Unfortunately, I haven't found anything about it yet and I've looked at a lot of code. My problem: I would like to receive the ALERT instead of the 1st candle 1 candle later. So the signal comes after the candle is closed and he should then wait 1
I just bought a new laptop with windows 10 on it. Now my mt4 does not appear right. Especially some of my custom indicators. For example I have an indicator called <Deleted>. It appears in the lower left corner and the text is all jumbled together and cant be read. Does any one have any idea what is