MQL4 and MetaTrader 4 - page 110

Please refer to the screenshot below. The profit is printed with OrderProfit()  once detecting OrderClose(...) returns "true". There's no problem with back testing. During the live test, you can see OrderProfit() of a closed order was printed in the experts log as "1.40".  However, the accurate...
Hi all, I have a code to calculate a lot size. This code should calculate how much lot size I will buy or sell depending on the max risk percentage that I put. this is the code to calculate lot size. double OptimalLotSize( double maxRiskPrc, int maxLossInPips){ double accEquity = AccountEquity();
Hi all, Is there any way to partially modify an order? Specifically, I place orders with attached S/L and T/P but after some time and as new calculations are been made in the EA I want to modify only the S/L and keep the initial T/P as is. Calculations of levels and modification of orders are took
I have no idea string that warning I try TimeToStr or String or Int..... not working string period = ( Period ()); int ip= 0 ; switch (ip) { case PERIOD_M1 : period="M1" ; break ; case PERIOD_M5 : period="M5" ; break ; case PERIOD_M15 : period="M15" ; break ; case
Hi, All my charts are not updated, they still stay at the data of Aug 13. Can anyone tell me how to update the charting of my MetaTrader 4? Thanks in advance. helen
Hi. I'm working on a EA where we start to see if it's possible to have more then one order triggered if the same trigger happens before we change trend. The code was first made to only do one order at a time with this: total = OrdersTotal (); //This is regular program buy or sell signal if
  Please help me!  (4)
I have a problem with this expert.The tests showed a very good performance.In visual mode works perfectly.The problem is that when I put on the charts constantly opens and closes trades.I would be very grateful if anyone can fix this problem
hello im testing a EA that has timeframe configs , once i got very good results backtesting but when i checked my settings the strategy testers 's TF settings was set to H4 but my EA's config was trading on m30 TF! so im wondering what happens exactly in this situation? if i set TF on both side on
Hi, I am running an exercise to close a position 20 candles after a MA Crossover . The code is made of 3 blocks, the 1st to open the trade, the 2nd to count the bars since the last MA crossover, and the 3rd to close the position. This code doesn't work and the position is closed immediately
Hi, I get this error "Tester: exchange rate cannot be calculated" when trying to backtest indexes such as _DJI on Alpari. This error doesn't occur on Forex, Futures or CFD just indexes. I saw that this error was mentioned in the old forum (in Russian) and using Google translate I somehow understood...
I currently coded an EA all in the OnTick function. Similar to this template: void OnTick() { bool longSignal = check MACD cross up; bool shortSignal = check MACD cross down; if (OrdersTotal() > 0) { if (shortSignal) OrderClose(Buy orders); if (longSignal) OrderClose(Sell orders); } if
Hi, I've recently opened an account with the broker Eurotrader and installed MT4, for some reason I cannot see the one click trading option even after enabling it. As you'll see here it's not there when I right click nor is there a little drop down where it would usually be
I have an EA file (ex4) however I cant move it onto MT4. it wont show when I try to move and when I go to open the file it comes up with places it tries to open in (internet explorer, MT4 platform etc.) but just fails and puts me back at square one. the file is different to other EAs that are
Thank you in advanced
Hey guys i'm new to coding and I was not able to find this anywhere. Anyways I need a code for EA that places a buy when/if price moves 50 pips up and sell when/if price move 50 pips down , also make it changeable in expert properties. Make it work for pairs that have 1 digit dec place , 2 digit , 3
Hello, everyone, I have met a problem when coding EA and I was wondering whether you could be kind enough to enlighten me. The internet connection to the server here is sometimes lost and reestablished automatically. The following is my understanding of EA working when internet is lost and...
Hello everyone, I am trying to set font style for an object label like italic? I found TextSetFont() function, but not sure how to use it with OBJ_LABEL. Thank you in advance.
hi guys , suppose i have a script , and i want run it only one time in period example if i set M30 at a start of 14.30 start after restart at 15.00, but if i set M15 start at 14.30and after 14.45 , one time , how is possible do that ? exist some library at_start_period( ) ??? thankz
Hello, Do you have any idea on how to send a ping to a signal provider in order to get the latency? I have found this in mql5 forum: The problem is that I do not find this information in my journal TAB when I subscribe to a signal (MT4). I also need to eventually
Hi, ocassionally my EA encounters error=132 or error=2 when OrderSend. What exactly do they mean? ("market is closed" & "common error") Is it EA related? and if so, what kind of mistake in the EA could cause this error and how to deal with it? with many thanks in advance.
  Brokerage  (3)
Hello. Which brokers allow for meta trader 4? Thanks in advance
Hiya, I have noticed that the EA I am copying has executed a trade today that my MT4 has not copied. Do I have to be logged in to the account at all times for the copying to work correctly as I was logged in to another of my accounts most of the day. If this is so, is there a way I can be logged
  round up & down  (6)
HI all, I need to round Bid to the highest and lowest value, as in this example Bid = 1.24231 I need to obtain 1.24300 (upper round) and 1.24200 (lower round). I’m trying to use MathRound() and NormalizeDouble() but it doesn’t work. Could you help me? Thanks!!!
Hi, I code in C++ and am looking to interpret an MT4 indicator I found which I'd like to try on a system I have. Please somebody explain what this code is saying in plain English for me MovingBuffer[i]=iMA(NULL,0,LWMAPeriod,0,MODE_LWMA,PRICE_CLOSE,i) ATR_Buffer[i]=iATR(NULL,0,AtrPeriod,i+10);
Hi, I have encountered a very odd behavior of an EA in MQL4. So the EA is attached to a given chart and a UI pops us which allows the user to interact with the UI(press buttons, view stats, etc). Once the UI is closed the EA is removed using ExpertRemove() function which then triggers DeInit and the
Hiya, i'm new to this, so please forgive me if its obvious :) If i write the MACD code, double MACD = iMACD (_Symbol, _Period, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0); How can i get a MACD line and the Signal line alert at cross over? What i would like to make is, When the price is Above the 200EMA
So, I've been dealing with the recurring issue that my EA kept opening positions till the numeric block stopped it: if (CalculateCurrentOrders( Symbol ) < MaxOrdersPerSymbol) DoTrading(); else return ; so what i tried to do is making a bool function to put a red or a green light in a determined
I am sort of new to this & am looking to subscribe to a signal. Which graph is the best indicator so I do not reach a margin call? IE when I look at the signal statistics would it be the balance graph, draw down graph, equity graph, balance graph, etc? Thanks in advance
hi i try add a symbol to a label but that just show the ? mark how can i fix it?? Label( 0 , "tx01" , 0 , 50 , 50 , 0 , "sample" , "Times New Roman" , 12 , clrWhite ); string gg=ObjectDescription( "tx01" ); ObjectSetText( "tx09" ,gg+ " ✓" );
Dear experienced traders, It seems not possible for me... Can I test 2 EA together in same strategy tester in one terminal? Thank you in advance and best wishes, Sky