MQL4 and MetaTrader 4 - page 949

Hello guys, I am getting very peculier behaviour from my code. The following snippet is where the problem occurs: if (OrderCloseTime()!=0) return (true);type = OrderType();success = false;lots = NormalizeCloseLotSize(OrderSymbol(),percentClose*OrderLots()/100);Print("Lots to close = " + lots);if...
  little help  (15   1 2)
I would appreciate it - someone to hide the stop loss, the EA thanks in advance
[Deleted]
MA200 = iMA(NULL, 1440, 200, 8,MODE_SMA,PRICE_CLOSE, 1); MA5 = iMA(NULL, 1440, 5, 8,MODE_SMA,PRICE_CLOSE, 1); 1440 sets the timeframe to 1Day, and 200 and 5 each represents the days for calculating moving average am i doing this right
The list of Top products appeared in MQL5 Market since the service was established. It is designed to draw attention to free and commercial trading applications that are the most popular among traders. At first, the list of the most popular products was based on a very simple equation: one purchase...
[Deleted]
Hello, is there a way to merge the backtests of several EAs, i.e. to find out what would have happened if one had run several EAs on the same account for some period of time? Björn
[Deleted]
My EA keeps giving me this error OrderSend Error 134 when i backtest it which stands for not enough money as the error description says. I added in the code    if (((AccountStopoutMode() == 1)&& (AccountFreeMarginCheck(Symbol(),OP_BUY, BuyVolume) > AccountStopoutLevel()))|| ((AccountStopoutMode()...
The MQL4 Book etc is excellent and also the forum is a fantasticresource, but to get additional examples etc would be useful too.   I do 90% guessing at the moment and limited imagination when it comes to using the code in different ways. I intend on continuing to read through the MQL4 website...
doing some testing on a program, I know what answer I'm suppose to get, but instead I'm getting these answers: suppose to be: 5      really is 58.227 suppose to be: 2      really is 28.227 suppose to be: 0.3   really is 3.8227 suppose to be: 50    really is 582.227 so to fix what I'm getting into...
[Deleted]
After putting on an external variable to put more control on Limit Orders, the backtest showed No change in performance. This was after changing the ATR Multiplier from 1 to 4. This should reduce the number of Orders filled and also  change the performance and profits. Here is the code as is in...
[Deleted]
  EA programming  (1)
Hi Everyone,I have been playing around with MT for some time and as a programmer wondered if anyone here makes money from creating EAs? I'm new to this but keen to find out if there is much demand for creating EAs? I'm keen to start out by doing this as a hobby and who knows maybe charge one day...
If EA is running on normal chart, I can use below code to check whether it is a new bar or not. However it does not work when EA is running on offline chart. Anyone know how to check new bar on offline chart? static datetime tLast = 0 ; if ( tLast == Time[ 0 ] ) return ; tLast = Time[ 0 ];
Hi i m trying to write an indicator that i will call from another indicator using iCustom.   Could someone please explain/give me what does iCustom returns? Buf_0[] arrays? If not that then what? If it fails to find the indicator what does it returns?  Could someone give me a very simple example...
[Deleted]
Hi: In my EA code, at certain stage, I want to BUY MARKET when the price is so and so. I am not sure which way is better(more reliable, more solid): 1)using OrderSend() to set up a pending order Or 2)let my code check the price at every tick, when it reaches the level, using OrderSend() to buy...
[Deleted]
Hi: This is not really a MQL code question. It's about fast navigation in Metatrader 4. Maybe somebody can help me out. I am trying to navigate back to the past Non Farm Payroll dates in 1 minute time frame, say in EURUSD pair . From Metatrader 4 History center, I have downloaded the data. I have
  Using iclose or Close[]  (11   1 2)
I am trying to cycle on the1Minute time frame the "Closing price of the 1 min candle" only. I have only been able to get the current candle" 0" ,so  it shows every new close price that occurs within the candle being formed (Code below).which is not what I want. Does anyone know how I can get the...
Hello Forum, I am trying to understand the concept of Indicator Counted and as a consequence, how to distinguish between when indicators recalculate during the current bar OR not !! ( I hope I am looking at the right part of the documentation) I've lifted the code below from the documentation https...
(MT4) Can I install MT4 platform on subfolder of desktop user profile - Vista 64 Bit?
  Multiple orders problem  (50   1 2 3 4 5)
Hi all, I've an issue with my code. When an order (buy or sell) open others come in a row. What I'm try to do is; if last order is a sell then open a buy order when price come above the order Openprice plus some pips(ReturnDist). if last order is a buy then open a sell order when price come under
Hi guys,   Nice to meet you. I first introduce myself. I am from Asia Hong Kong and is a CFA. Now I start learning MT4 EA and automated trading.      As I am not graduated from Computer Programming, I have lots of questions when start learning the programe in MT4.   I have spent about 2 months to...
[Deleted]
i keep getting this OrderSend Error 130 error when i back test my expert advisor, i already googled it and found out that it is related to stoploss and take profit value being lower than the brokers limit hence i raised it over eer the brokers allowance but the error still persist in my journal...
I am just trying to figure out how to write output to a local file and the following lines compile and do not produce an error when ran, but I cannot find the file anywhere on my pc.  I checked the /EXPERTS/FILES & /TESTER/FILES directories and they are empty. handle=FileOpen("forex.csv",...
  MT4 doesn't have long to live  (827   1 2 3 4 5 ... 82 83)
These are the pies. See https://www.mql5.com/ru/forum/6337/page4 Renat : We have already achieved a great speed boost in the development version (it is for internal development) in the Open Price mode and solved the issue of speed difference between MT4 and MT5 testers. The speed in Open Price
Is it possible to avoid order history , type "balance" in my for next loop?  I've searched but found nothing enlightening.  I need to ignore results of type "balance": // return last closed ticket (returns -1 if not found):int LastClosedTicket;{   datetime last_closed = 0;           // close time...
I have a function here that i use to calculate the total risk per currency pair. I have it displayed on my chart so i know my total exposure if all trades on that pair hit there stop loss. void Pair_risk() {   if (show_risk==false)return; int i; double trade_cash_risk,percent_risk;...
[Deleted]
Guys I have a problem with my MT4. When I connect from home it login without problem, but from work it does not? What can I do to let MQ4 connect from work? Appreciating any help
Hello, I am new to MT4 and MQL4. I tried to run an EA as an Indicator and I receive the message "2013.01.28 19:14:56 Expert 'AAAA' is not custom indicator and will be removed". My question is how can be distinguished in code between the two ? At the first look I see no difference in coding.... out...
[Deleted]
  Hi guys!  (4)
Hi guys! I whant to make one EA! I dont now how to make for  sending  a new pending order only when the last pending order become a normal order, buy or sell! Thank you verry much guys! If somebody can help me? ...mehba752007@yahoo.com
I have alerts that display details of an executed trade once the trade line has been executed.  Problem is, the alerts display but the trade is not executed.  So the criteria for the trade is met an and the trade is not executed but the alert line is.  This EA has worked in the past and the trade...
[Deleted]
Hi there all, Am I allowed to run more than 1 EA on the same profile but on many different charts within the same Profile, please? In another words: I have many charts opened under a certain Profile. I need to run an EA on each one of these charts/ trading instruments in the same time. Am I allowed...
Hello, I am in need of some help regarding an EA I have programmed that has indicators which can be set to true or false, currently I use an else statement to call another function that will run if the existing function is set to false. The problem with this is that I end up with a huge list of...