MQL4 and MetaTrader 4 - page 193

hello i have a indicator which check break out price line. here we can see Red line is sell line and Blue is buy line. when price break Red sell line i want to get alert vice versa Blue buy line. but i want to wait upto 2 bars until Red or Blue signal bar break out signal bar. for instance, below
[Deleted]
Hello everyone I want a code, but whatever I think I can not get the result We have an expert who opens 1 position in a row with every 10 pips (We have no problem so far) Now I want to write a code that checks all the positions with the opening of each position to see where we are at the opening of
hi, i need your help on both indicators. I would simply like to add that the alerts are only triggered on closed candle because otherwise I have too many false signals. I would really like very much that you can make me this very small modification. I am a young student so I would like to do it
Hi I wrote a test ea and while back testing , MT4 stops and i see this message in the journal tab: Access violation read to 0x00000003 in 'C:\Users\H\AppData\Roaming\MetaQuotes\Terminal\E05C74117B3E2588F72872BDDB509419\MQL4\Experts\2020-Test.ex4' after that if I click on start button again MT4
Dear Forum members, I am using Metastock and Reuters DataLink for my data feed, and have created some proprietary indicators / models. Some of these indicators use data not available in MT4 as provided by brokers. I would like to have these indicators into MT4, but I am not sure how to achieve this
Hello, I am still learning MQL4. I have written this code as part of my EA. double maxLossDollar = (MathRound(AccountEquity()/100) * 100) * maxLossPerc; Alert ("maxLossDollar: " + maxLossDollar); The above code Rounds up to nearest 100 when the balance is between x50.01 to x99.99. Any guidance
If I were to develop an expert advisor using indicators with different timeframes, would it work only being installed in one chart on MT4? For example: I'll use EMA on H4, and then MACD on M15 double MA = iMA ( Symbol (), PERIOD_H4 , 26 , 0 , 1 , 0 , 1 ); double MACDBase = iMACD ( Symbol ()
Hi, Im still a newbie though. Maybe i still havent discovered smth yet, bu I was wondering MQL has callback functions for whatever events are happening. The similar way you have a start() or init(), having functions like on_order_close() or on_new_period_start() would be nice. Event driven...
iBarShift - MQL4 Documentation states that when a match is not found it returns the nearest (exact == false). In tester (Build 500) on M15 bar <2001.02.19 01:30>, iBarShift returned 11, for a request of <2001.02.18 22:00> Time[11] = <2001.02.16 21:00> 49 hours earlier - Last bar before market close...
I am trying to open trades in loop depending on the variable value (4,6 or 10 trades) but it sometimes miss the trades, meaning if its supposed to open 10 trades then it will open only 8 or 9 or 7 trades , and if its supposed to open 4 trades its ends up opening only 3 ,2 or 1 trade here is my code
Evening people. Second time posting and the feedback is incredible really pushing my learning along. so my final issue with this EA is i backtest it yet it places no trades at all. Sometimes ill see it says "limit" trade and even then it wont be filled. Below is my code and any corrections and advic
good day guys i have a question about deleting pending order on ecn account , the orders type are sell stop and buys top i use a simple function to delete orders , as below void ClosePendingOrder() { for ( int i= OrdersTotal ()- 1 ;i>= 0
hello all, can you help me for my code please? I placed an ARROW in this code(the code shows an ARROW when price break the highest(object named "BoxBreakOut_High") or the lowest( object named "BoxBreakOut_Low")),the problem is it does not work well because it saved all the previous day HIGHEST and
[Deleted]
On nt4, where it says expected slippage e.g. 2.60 - is that in pips
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
This website uses cookies. Learn more about our Cookies Policy.