MQL4 and MetaTrader 4 - page 170

I'm fairly certain this is a ticket selection issue but I can't quite work out where I'm going wrong or how to fix it. Basically, if my entry indicator changes direction it should close the open trade, it's not currently doing that... it just keeps it open and I get error 4108 or 4051 in the
[Solved: turns out I had created an enum called "OrderType" in another file which was shadowing and wreaking havoc. ] Hi all, I'm stuck. For some reason my OP_BUYs are working, but when I try to open a OP_SELL, OrderType() always reports 0. I'd be super-grateful if someone can help me with this
In my EA I have a simple trigger to send an email something like this: bool email_sent; [....] void OnTimer () { if ([no positions]) email_sent= 0 ; if ([positions open] && [some indicator > some value] && email_sent== 0 ) { SendMail (header,body); email_sent= 1 ; } } It works nicely
I am invested in a scheme whereby a company offers algo trading and any profits are shared between myself and the company. From Jan 2021 to now they have never made a loss. I am half convinced this is a ponzi scheme. In addition I noticed that their broker is in a country where financial oversight
I am facing a difficulty in sending an alert mail when a certain condition is met. I want it as an alert mail for the manual trading so that I am with the trend . This mail has to be only once when MA50 is above MA200 for sell position and viceversa. I have done workaround with the Ordermodify ()
Good morning Can someone explain me what the const before a function does? bool ReadOnly( void ) const { return (m_read_only); } //with const bool ReadOnly( void ) { return (m_read_only); } //without const does it make a difference if the function returns a fucntion or
Hi all I'm converting a code from MQL5 to MQL4. In code, i have faced BarsCalculated() which i need help to convert it to MQL4. This is the code which computes and draws Zigzag on RSI indicator (=Zigzag with input of RSI values, rather than price values)
Hello everybody, I'm trying to create a expert advisor (mql4) with multiple dialogs using standard library. Foe convenience all the components inside dialog are prefixed with dialog name. This is what I got so far, so there is one problem that I cannot figure it out: when user click inside dialog1
  A simple program  (3)
Hello, I am a beginner in programming and at the moment I am trying to learn to code with the mql4 language. I am trying to understand the concepts of function variables, predefined variables... But I get stuck on my program and I can't find the errors... I wanted to create take profit and stop
Hello, Trying to install MT4 (oanda4setup.exe) on Ubuntu (20.04.2 LTS), using Wine 6.0. The terminal is running but the folders config, history, logs, MQL4, profiles, Sounds, templates, tester are not present in the folder. I've tried to find the path of the data folder from terminal but can't
The Algorithm of the Trailingstop only Long Example: My Try: for ( int i= 0 ;i<limit;i++){ double currentShortMA= iMA ( NULL , 0 , 7 , 0 , MODE_EMA , PRICE_CLOSE ,i+ 1 ); double currentLongMA= iMA ( NULL , 0 , 13 , 0 , MODE_EMA , PRICE_CLOSE ,i+ 1 ); double previousShortMA= iMA ( NULL , 0 , 7
I wanted to start a thread to discuss and develop an idea that I've been conceptualizing; a method to eliminate perpetual loops when working with multiple symbols in one EA. The idea is rather simple.. EA has a list of symbols to use for signal calculations , EA opens a chart for each symbol.&nbsp
Hi, I normally start my terminals in portable mode by a short-cut: path..\terminal.exe /portable. Yesterday I saw in Windows' TaskManager-Command-Line-Tab: path..\terminal.exe /portable /skipupdate. The terminals were started automatically after the last terminal-update last weekend after my...
Hi, I attached an indicator to a chart on MT4. Since than MT4 crashes when I tried to open it/ restart it. How can I open the MT4 terminal? Should I reinstall it
Hi, We have a example code in IndicatorBuffers page that use rates_total and prev_calculated, My problem is that in this code it calls candle zero information But when we try to get the information of previous candlesticks, it gives an error: array out of range Full edited code
Hello, here it is for me to open the MT 4 platform (broker traders' way), I uninstalled several times, try to open as administrators try, on 2 different PCs, at the end of the 'installing mt4 sa connects me to the MQL 5 Service, I connect and I can always open the platform, if anyone is why, if you
Hi. I want to run it during 24 hours. If I set it up as following, EA does not work. Start time=24:00 End time=24:00 What should I change it? If I remove these code, it does not compile it either. Thanks in advanced. bool sleepTime() { string dt = TimeToString ( TimeCurrent ()); string
Not sure if there is a technical solution to this, but I am trying to move an MT4 terminal from one VPS to another. So currently the live MT4 terminal is on VPS1, its a demo account via IC Markets, with 99 charts and 99 expert advisors running. On VPS2 I have set up a new MT4 terminal, inputted my
  *** EA  (1)
Hi Can somebody pls assist, as I cannot get this trading bot to work on my MT4 platform. I purchased it 3 days ago, and I still cannot get it to work on my mt4 platform? I sent the developer a message, and i just get a general answer, which I tried anyway and got nowhere. Can I get my money back
I have a problem with Metatrader 4 1090 this week after upgrading Windows 10  Pro N with the latest version to fix the processor hardware bug recently discovered. My system is an intel Core i7 8 core Sandy Bridge mobile processor with clock speed of 2.2Ghz and 16Gb or RAM.  It is fairly old now but...
Something is off... I've tested my EA before successfully, but now it does not work. The value for the CCI is always "0". cci_long= iCCI ( ChartSymbol (),cci_timeframe[pos],cci_bars, 6 , 0 ); Print ( " CCI_long = " ,cci_long, " " , iCCI ( ChartSymbol (), PERIOD_M5 , 13 , 6 , 0 ), " "
I have a MA line, say 28 exp close, and I want to have some kind of "shadow" line that mimicks the exact same trajectory, but a certain number of PIPs or points or rather price figure above or below the main MA line. I've been thinking about it and I can't figure out how to do it. Someone help
I just wrote an indicator for a friend, which draws several TEXT objects near/at each Low[] of several bars, only on D1 chart. I also added a fixed "padding" to move those objects a tiny bit away from Low[] price. This indicator works fine for me. But my friend has a habit: he often opens a chart
I am working on a trade copier and sometimes the copier cant open, close or modify an order at all , and it throws an off quote error. whats the best approach to deal with this situation to make sure every order is executed on the client account? because I was thinking of sending the order again (if
Sorry for the weird post title , I dont really know what to call this it , looks like a curved progress bar or half pie chart but dont really know the name of this type of charts. Can someone please have a look at the attached image, I was hoping to draw something like this in an EA or indicator but
Hello, I have a Simple Question that may seem elementry to you. How do i wright a Line of code that shows me the Time of Opening of an Order? i know about the time Operators, but they all can return the time of a Bar, not time of an Order Opening. even when i use TimeCurrent() in the Function of
Dear all. How do I code if I don't want to make EA run on certain symbol? I took the code from other topic. Thanks in advanced. int OnInit () { // Check Licensing Restrictions if ( boolRestrictOnInit() ) return ( INIT_FAILED ); // ... return ( INIT_SUCCEEDED ); // Initialisation complete }
hi guys , i wrote an indicator, and when i use it in expert in strategy tester, it just comment me true valumes for only 5-6 candles. then it comment a fixed wrong value like 2147483647.00 void OnTick () { if ( NormalizeDouble (Volume[ 1 ], 0 )<= 200 && NormalizeDouble ( iCustom ( Symbol ()
I want to draw many horizontal lines across the chart and use them as some kind of grid. I want to have a certain distance between any two of them. That "gap size" has been determined by eye. I look at it and decide whether it's good or not. My first attempt at it was to divide the chart area into a
I am trying to find the correct code to display the Day and time Date & Time :"+TimeCurrent()+" Day: "+TimeDayOfWeek(Time[0]) It currently displays as Date & Time: 2021.09.07 13:50:40 Day: 2 What I want to do is: Date & Time: 7th Sep 2021 13:50 Day: Tue Or something similar. Any guidance would be