Download MetaTrader 5

MQL4 and MetaTrader 4 - page 4

To post a new topic, please log in or register
hi friends, I found a problem regarding the array size in my Custom indicator . When I change my timeframe -for example change to M30- sometimes my indicator does not work properly it takes the error of "array out of range", but when I manually change the timeframe from M30 to another timeframe and...
Hi all, I would like to get matched moving average of highest & lowest price for each day. Example: Highest price for yesterday is 1.2 20MA= 1.15, 21MA= 1.22 I want to get the nearest MA that match with the highest price automatically which is 21MA. Is it possible to do that? Thank you. Add-on:...
About the AutoTrading button at the top of the Terminal, which I recall used to be named "Experts" or whatever: I was fairly certain that pre upgrade, the "Experts" switch would pause my EA, Alerts, everything the EA did. Now when I click the "AutoTrading" button so that it displays the red dot, my...
Hello all, first off apologies for the basic question... I'm a newbie in coding. I am profoundly confused! Below I did the following: void start(){ double monthlyHi0=iHigh(NULL,PERIOD_MN1,0); Print("Monthly High 0 is: "+monthlyHi0); double monthlyHi1=iHigh(NULL,PERIOD_MN1,1); Print("Monthly High 1...
Hi, How can i check if a pending order has been triggered? I have two pending orders and want to cancel one if the other opens but can't see a method to check if the order has been triggered? Thanks, Tori
Hello,  m‌y EA is supposed to never put takeprofit/stopbuy/sellstop so it will close with a minus position but sometimes it still does it. Here is an example: http://imgur.com/a/xGWKq (i hope it's not too small). EA puts a buystop at 1.06285 and it bought at 1.06290. Is there a possibility to check...
As the title says, when debugging, the debugger randomly stops with uninit reason 4 ("Chart Closed" according to the Uninitialization Reason Codes). ‌It could be anywhere from 7-15 minutes.‌ I'm not closing the chart and there's no functions in the EA that would cause the chart to close or even...
I get this error on the following code: class ConstantBar : public CObject{    private:            ConstantBar(int pCBType, int pRange, int pArraySize, double pStartAt) : nPoint(1) {                ...             };                    ConstantBar(int pCBType, int pRange, int pArraySize, double...
Hi everyone, ‌ I'm using a fib-tool that draws trend lines with labels at the right side, something I find very convenient, so I want my trend line‌ to have a label on the right side too. ‌I've added a label in the code‌, and the compile is without errors, but the label does not show up. Can anyone...
I‌ am a developer and I want to work on 1 terminal, If I use 2 terminal, I have to copy sources to 2 terminal. ‌‌That's Annoying‌. ‌ C‌an You do that like this picture or D‌uplicate same mt4 process (not copying terminal folder. that needs copying source too.) ‌
I set EventSetTimer(1) in OnInit (bool result is "true") , and I put my code in void OnTimer, but the indicator is still going through OnCalculate, which defeats the purpose of using OnTimer because the data received from the broker isn't faster than 1 second in some cases. Is there a way around...
Hi W‌hen I compile MQL5 an EX5 file is created in the ...Teminal\long-unique-number\MQL5\experts folder. I‌ am using MT4 and so no EA appears in my navigator window, even if I move the EX5 file into ...Terminal\long-unique-number\MQL4\experts Is it possible to use compiled MQL5 within MT4. Is a file...
Hello. Does anyone have a method in MetaTrader 4 to play a sound when an order is opened or closed from a signal? I would like to be a alerted when my account makes trades corresponding to the signal I am subscribed to. Can a script be written for this? Thank you.
Hi guys i`m having problem creating a bar counter code.Basically this EA would be a statistical tool for me and it would help me very much with my market research.It would count how many consecutive BEARISH bars appear before a BULLISH bar disrupts the sequence, and how many consecutive BULLISH...
As the title says, I'm having serious trouble installing any platform of MetaTrader on my computer. ‌‌‌Initially I downloaded MT4 from a different site from the main site, an affiliate but since I'm new here I don't know if I can mention the name. Failed to install, then I tried installing MT4 from...
Hi,All: I'm from China. Recently, I'm working with ea that concern the TimeZone of price data. Now I'm using the data from MT's data center, and I want to know the timezone of these data? is it GMT(8)? thanks
It also seems to change, has anyone noticed that? Thanks, Matt
  TRADING (2)
Hello, My name is Ricardo, I have not seem your trade in my plataform Meta Trader 4 for Avatrade.- Could you tell me if I made mistake Thanks for your comments‌
Hi everyone‌, ‌I try to test my strategy on the tester but I have weird ask price (show in the picture 1). They seems to be "too high‌" compare to the bid price. I've tried both (in the buy function), ask price (see pix2) and market price but the price seems always too much compare to the bid...
are they the same? if I put my logic in start() it works just fine but void tick() doesn't seem to do anything. Also I realised that when the price spikes pretty quick, my EA can't really catch it in time with start() so I thought tick() might be a better use..but then I just read that they are the...
  question (5)
can someone tell me what code i would use just to get a ea to buy 0.03 lots of the eur usd currency pair if it rises above a particular price , for example 1.0553  i tried to do it but the ea kept buying a additional 0.03 lots every tick  i tried to use the orderstotal function to ensure the ea...
Hi all I would like to know what function I need to use to select orders. Example I have 10 orders: 6 open, and 4 pending. 1 ==> OP_BUY 2 ==> OP_BUY 3 ==> OP_BUY 4 ==> OP_BUY 5 ==> OP_SELL 6 ==> OP_SELL 7 ==> OP_BUYSTOP 8 ==> OP_BUYSTOP 9 ==> OP_SELLSTOP 10 ==> OP_SELLSTOP My questions are how to...
int orderstotal = OrdersTotal();    int orders = 0;    int ordticket[30][2];    ArrayResize(ordticket,30,30);     for (int i = 0; i < orderstotal; i++)    {        if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)==true){        if (OrderType() != OP_BUY || OrderSymbol() != Symbol() ||...
Hello, m‌y EA suddenly stopped placing orders so I am trying to debug and find out why not. OrderSend now seems to return -1 but when I add GetLastError() just after the OrderSend, nothing happens. What am I missing here?
Hi , I have an <> indicator and as you know it's ex4 so i cant edit and no values for icustom,  it's creates basic abcd formation, when it's working there are a lot of abcd formation nested on the chart (i attached pic),    so i want to get last D and C values from chart when its created.. i tried...
Hello there, Can someone guide me on how to make an EA on each chart dosomething once when a button ispressed in any one of the charts in the same terminal? My guess is that I need touse Global Variables here. I am using MQL4 and not MQL5. Thanks in advance.
Hi all, ‌ I‌ am running into an issue which I hope you guys can enlighten me. ‌ I am trying to adjust my takeprofit and stoploss dynamically such that increasing takeprofit and stoploss by 20 pips whenever the market price is within 10 pips of the original takeprofit.  T‌he following is a part of my...
Good day . ‌I am trying to place an order at 10 points below from the LWMA using the following line of code: if ((Ask<=(iMA(Symbol(), 1, 2 , 0, MODE_LWMA, 0, 0)) -10*Point) ‌It does it right only sometimes. How do I get it to always count the correct distance from the ask line ? Thanks in advanced.‌
Hi, H‌ow do I get get X and Y value to determine chart position?  Is there a function or any work around to get values?  I try to look but couldn't find it. Please see screenshot.   ‌Thanks in advance! ‌‌Regards, Pumin ‌
hello i'm trying to record support resistance levels of the fx market with an array. anyone who has done this before can you write reply please i don't want to reinvent a wheel 1‌. the array will check last 100 bars on M1 periodicity chart to find highest highs and lowest lows ‌2.different code...
1234567891011...1217