Download MetaTrader 5

MQL4 and MetaTrader 4 - page 37

To post a new topic, please log in or register
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...
‌Hi guys ‌ So i have a Pivot Point indicator, and as you can see it always connects yesterdays PP / Support / Resistance levels with the ones of today with those steep lines: ‌ ‌I was wondering wheter it was possible to avoid this behavior and just NOT draw these connections? Can you somehow define...
Hey guys,I am looking for a script that checks for open orders and if there are more than one (two, for an example) it closes the oldest one/ first opened. It does not touch the pending orders if there are any, only open ones. Can you please point me in the direction where to get this? Thanks!
Hi I‌'ve just started learning MQL have a question...... I‌ am trying to get the price range of 3 consecutive bars(the current bar, 1 before and 1 after).  Help pls ‌
Hi all, ‌ I‌ am running into an issue which I hope you guys can help. How to code it if I only want to trade for the first signal after stochastic cross from level 25 and SMA 100 higher than SMA 200 T‌he following is a part of my code so far: ‌...
Hello P‌lease I need to know how to retrieve the color of a chart (background color) i‌s there any function that returns the above ? ‌
Hello! ‌‌Recently my MetaTrader 4 Market tab inside the Terminal window stopped working properly. Every Market tab (Main, Favorites, Purchased) shows a blank white screen. The same thing goes for all of my platforms running MetaTrader 4 version 4.00 build 1045 (3 Feb 2017). I have tried restarting...
Anyone know why when I use iMAOnArray the lines created change position when I change the length of the chart history to be used ? for instance if I draw lines for chart history of 500 bars the lines reposition if I change the chart history to be used to 1000 bars but I am using MA periods of only...
Why is it that some UnInitializationReason do not trigger, e.g. REASON_CHARTCHANGE?
When I use the custom indicator, it shows the graph as follows  ‌ When I use the Expert Advisor with the custom indicator, it shows the following  ‌ It also repeated opened a lot of custom indicator when I am doing backtesting. How should I change the EA such that It only opened a custom indicator;...
Hi comrades. How can I print the profile I am using? Thanks
I have registered for a Virtual Server on MT4 through the MQL5 website, I did this so that I could get push notifications from alerts while my computer is off but the alerts don't get sent. I have push notifications set up, I have synchronized all, but nothing is working. A fix to this issue would...
is there any code base available which could directly open multiple trade on different currency pair based on any single trade pair. for eg : suppose I put up any tarde at certain moment for EURUSD,then at the same time multiple trade could be opened with other USD pairs(AUDUSD,GBPUSD,NZDUSD,USDCAD...
Hello guys, im facing issue with BasicHashLoop in  "hastable-templated.mqh" which I am using for having avalable something like dictionary is in different languages. Ofcourse I would like to not use third party codes, but Im not sure how to solve the situations that I need to hold number(count) of...
So when using different functions to check if an account is a demo or live acct, is there a difference between functions?  Specifically, is there a difference in how the functions check to see if account is demo?
fellow programmers, n‌eed help on reset the flag for LotSequence counter as below. ‌The LotSequence() function will run a the beginning of new bar, H1Function DailyProfit() will check Current Daily profit.if Daily profit <0, counter should run 1 time and lot should be StandardLot*Multiply_1.On the...
I have couple of questions regarding the installation path for Scripts folder on some of PCs. ‌‌When I install mine, it located at C:‌/Program Files (x86)/<broker> but my friends installed at the C:\Users\User_account_name\AppData\Roaming\MetaQuotes\Terminal\Instance_id W‌ould like to know why is it...
1. Is it possible to get an object's index value by not having to cycle through a for loop with ObjectsTotal()? ‌2. Is it possible to get the index value by shift of a Channel's OBJPROP_PRICE3? (i.e., the trendline in a channel that has a single anchor point)
Who has this indicator's mq4 file? Please help~  
Basically I want to draw a short horizontal trend line from a specific timestamp to any position X pixels to the left or right.  ‌ You might suspect I have problems with the zoom level, so I want to use pixel instead. While this is also the case, I already solved the issue by simply calculating the...
1...303132333435363738394041424344...1245