MQL4 and MetaTrader 4 - page 81

To post a new topic, please log in or register
hi, I am experiencing problems with the prev calculated variable in indicators for mt4. In the first calculation its returning 10000(for example), in the next one - 0 (so far its normal).But after that it starts looping - one time 0, one time the same 10000, and this is causing the indicator to...
After 1 March 2019, MetaTrader 4 desktop terminal builds below 1118 and MetaTrader 4 Android terminals below 1104 will no longer be supported. Older terminals will not be able to connect to brokers' trading servers. Please timely update your terminals to the latest versions.
any body please help i want to deduct commission for ecn acc by  TesterWithdrawal() method in strategytester i just follow the code  bool TesterWithdrawal(double money ); double com;void OnTick(){int total = OrdersTotal();for (ig=total-1; ig >=0; ig--){if (OrderSelect(ig,SELECT_BY_POS...
If you are subscribed to a signal  Then signal account get funded by it's trader  All subscriber's trades get closed immediately and opened new orders in the same previous locations and level price with less volume  How such dummy, stupid thing is allowed, it cost me and all subscribers to lose the...
Hi All, I am currently trying to take baby steps in the world of MQL4. I am trying to load a very small amount of data into an array using:   do      {      count=CopyRates("GBPUSD",PERIOD_M15,0,10,test);      printf(string(count) + " " + string(GetLastError()));      Sleep(1000);      }   while...
Hi Hope you're all doing great, I want to use array as an input of my function. My function can work with all kind of arrays (1D or 2D or 3D arrays) so the array that I'm going to use as an input in my function might be a 1 dimension array, or even 2 dimension or even 3 dimension. Now I want to know...
Hi, i need to chage the multiplier by increasing +1.  like this 0.01,0.02,0.03,0.04...++ double NR(double thelot) {     double maxlots = MarketInfo(Symbol(), MODE_MAXLOT),     minilot = MarketInfo(Symbol(), MODE_MINLOT),     lstep = MarketInfo(Symbol(), MODE_LOTSTEP);     double lots = lstep *...
Does anyone have same problem after calculate the cross signal for MACD as it will emerge a several signals in a second so that EA will open a several orders at the same time due to these signals. I tried and though many methods such as limit the OrdersTotal & Sleep(90000) etc., but all did't work....
Does anyone know where I can find a Renko EA that will draw Renko blocks based on the CLOSE of the H1/D1/W1 timeframes instead of the M1 timeframe which pretty much every Renko EA uses? I've searched everywhere and can't seem to find one. Or can someone point me towards how to modify an existing M1...
Hi I'm having trouble to select the first and last order that is opened in each currency pair and then closing them when reaching a certain profit both of them. Im trading a certain strategy that if the first order and last I want them to close first. so if I have 3 trades open, I want the first and...
I have a problem with use a indicator in EA, I use iCustom() function for read status of this indicator, but when I backtest this EA, a lot of message print on journal tab as below picture: How can I prevent of it?
I know this error has been discussed many times but the ones I saw dealt with indicators and did not really address my problem. Can anybody tell me why the following code in my EA gives an "Array out of range" error? for (int j = 0; j < WPR_MAPeriod; j++)         {            WPRArray[j] = iWPR(NULL...
Sometimes I need to port an advisor to MQL5. To get this done I'm looking for a way to convert MQL4 style indicator invocations more easily. So instead of obtaining a handle and using CopyBuffer I'd like to be able to do this: // MQL 5 code blockdouble ima=iMA(symbol,timeframe,ma_period,ma_shift...
Hi all, My indicator runs on every chart that I open, but the problem is that the memory usage (RAM) increase madly. So I tried to free and delete all general arrays and objects of not in focus charts, using anything: ArrayFree(array_name) ArrayResize(array_name,0) ObjectsDeleteAll(EMPTY,EMPTY)  but...
Hello, Is `IsTradeAllowed()` replaceable with `MarketInfo(_Symbol, MODE_TRADEALLOWED)` and vice versa? In the docs is written that `IsTradeAllowed` is equal to  `TerminalInfoInteger(TERMINAL_TRADE_ALLOWED )`. However, it is not clear is `IsTradeAllowed` means the trading is allowed by principle or...
Is there a way to read the account history from outside ( for evample via investor password ) like MyFxBook does?
  Stop loss (3)
Is it possible in EA to modify stop loss above buy order open price in order to trail the stop and gain profit?  I wrote the code but it returns the 130 code error. Please guide me in this case.
  Copy Trade (5)
I am looking to copy trade expert same account with basket profit to close both trades .   when the mother expert open sell order - copy trade open buy = close both when make profit  .  Example : First chart Mother expert  Sell GBPUSD  Second chart  copy  Buy EURUSD . target basket profit 0.10 close...
I am looking a programmer to correct errors in the mql4 file. Pleas help.
All - How do I detect when a stop loss or profit limit event has occurred? Specifically, if I placed a BUY order and placed an OCO ---> 1. SELL_LIMIT 2. SELL_STOP how do I know if when either #1 or #2 occur? Also, if I hit a SELL_STOP (or BUY_STOP for that matter), how can I determine the...
I'm not sure what's happened but it looks like mql.exe has been replaced with cpp.exe in build 616 ?? I did have sources outside of the MetaTrader folder, and was running mql.exe to compile, and then copy the ex4 into the data folder. That doesn't seem to work now with cpp. I get... MQL4/MQL5...
Goodmorning everyone. I'd be trying to finish my indicator, but I can not understand, what are the functions, in order to create the labels, similar to those that are generated automatically when you open a trade (those on the left of the graph, which are anchored. If moves forward, backward graph,...
I'm looking for a broker which gives easy trading access on EAs ( binary dot com was offering a MQH library to connect on their APIs time ago ). Is still there a binary broker which offers this easy access to trading/account history?
As customary, many of us will use: SymbolInfoDouble(NULL,SYMBOL_BID); or SymbolInfoDouble(NULL,SYMBOL_ASK); or MarketInfo(NULL,MODE_ASK); and those will work ok most of the time, however, for some of us they return 0 while implemented in the Strategy Tester. I am presenting here an alternative...
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...
Hello, I've got a Custom Indicator which outputs Entry Signals on the chart. In the Data Window I can see that the Indicator has 5 "Index Buffers" and outputs "Buy", "Sell", "Entry", "SL" and "TP". I want to query this Indicator in an EA via iCustom. The Indicator has several parameters. Mostly...
Hi, Is it rightthat indicators can only work at ‘bar’ level, not at ‘tick’ level? thanks
Hi, just want to create a script that saves quotes of a couple of pairs. My intuition is that it should not be attached to any chart, should not be even an EA, just a simple Script. What is the preferred way to do this in MQL4?
i have an indicator that i am trying to modify. it shows text output for the current pair chart and the time frame. both outputs are on the same line. i would like to have the current pair display over the time frame. not sure how to change the coding.
I need help for my MT4 platform, i want to reset it to factory setting .