Download MetaTrader 5

MQL4 and MetaTrader 4 - page 58

To post a new topic, please log in or register
I've been using the GlobalVariable....() functions to create my global variables for my EA but am wondering if I'm making life too difficult for myself. I will be running this EA on multiple charts in the same terminal at the same time and have been using the GlobalVariable...() functions to avoid...
Hello to everyone, i would need to use this operator || Between functions but I give you an error: 'if' - expression of 'void' type is illegal. if( myFunction1() || myFunction2() ){      myFunction3();}
Hi Gents, I have the following code  it works perfect on my EA  tester but when it comes to automatic validation  it fails int start()  {//----int TCC = 0;   for(int ii = OrdersTotal()-1; ii >= 0; ii--) {     if(!OrderSelect(ii,SELECT_BY_POS,MODE_TRADES)) continue;  if(OrderSymbol() != Symbol() ||...
Comments that do not relate to the "Spread filter for EA", have been moved into this topic.
Please help with my spread filter. I'm using ECN 5 digit broker but when I use this code, the ea doesn't seem to read the spread correctly. On my EA I do normally put an extra 0 eg  500 for a take profit of 50, just as an example ( I've tried to add/take away 0s with no luck). Is there and easier...
Hello guys. Can you tell me if the code in this way can be correct or where i`m doing wrong? Thanks to everyone.     //++++ Spread Filter    extern double MaxSpread = 5.0;    int MarketInfo()        if {(StringFind(Symbol(), "JPY") >= 0){ {Spread = (Ask-Bid)*100; } else {Spread = (Ask-Bid)*10000;...
Hello  every one  the Below Function is to get the Last order lot size and multiply it by 2 it is is lose trade but it is not working properly , can you help  double fLotSize(){double fnewlot=Lot_size;int i =OrdersHistoryTotal();for (i;i>=0;i--){    if (OrderSelect(i,SELECT_BY_POS...
Yes i know that you can make any variations of the trailstop put into a script or EA, but i`m curious how the built -in trailstop work. So for example: if i enter long at ask 1.2345 , and the stoploss is 20 pips (1.2325), but the trailstop is 10 pips then after the price goes to 1.2346 the new sl...
Hi How do i get the highest AccountBalance(); between two dates, for example between 2015.01.01 until now?
I have 2 monitors with different mt4,   At first monitor(mt4) I attach all major currency pairs and all in H1 period, and the other monitor only show D1 period. the question is : how If I click GBPUSD in first monitor, and the other monitor automaticaly show GBPUSD in D1 period ? Is there any...
Trying to figure out how to find the high between two points in time.  From January 1st to March 1st.  Going in circles.  Perhaps someone could look at the following code and tell me if I'm headed in the right direction. Thanks!...
I have opend about 20 currency pairs and got them arranged next to each other with the "Arrange windows as non overlapping tiles " button. The problem is that i have some indicators on all of this charts but they don't resize with the window. They stay as big within the chart window as the window...
I have had some issues with calculations involving the Ask function. It is returning some very strange results from the following simple code: Alert("Ask is ", Ask); File attached for output. It displays the correct Ask of 142.183, but then other values which are obviously incorrect. The broker is...
Hi Forum, I have massive problems now after I had to buy me a new pc that runs with win7 ultimate 64bit. Before I had an old laptop running 32bit win7 ultimate and never encountered those problems. I use the MT4 of JFD brokers and Pepperstone - and first I like to know if its possible to choose a...
what is the diff between : init() deinit() start() vs OnInit() OnDeinit() OnTick() ?? tks
First of all let me say that I am entirely new to MQL programming. But I'd like to know how you can access previous price/volume action to do calculations with it. I think it must be something like this (taking the price as an example)i = price i = 0 if (price[i] < price[i + 1] && price[i + 1] <...
Dear MQL4ers, What I would like to know is that, If I used the OrderSend() function with a slippage = 30 to send a pending order, and then I modified this pending order using the OrderModify() function, Will the OrderModify() function erase my slippage that I've set in the OrderSend() ? Many Thanks...
Hi All I have downloaded a year worth historical data and they are in M1 format, I would like to test my strategy on M5. I imported them into history centre under M1, and when I run my test on M5, it complaints that it doesn't have data on M5. how may I convert them into M5 please? Regards
Need help to run backtesting using MT4 faster, What do I need for doing it ?
Hi, In MT4 a Profile is a collection of charts projected as 1 window. one can add or remove additional symbols manually is there a way to populate a Profile automatically ? and reflect all symbols with open orders. so we are looking for functions/script to add/remove a symbol from the Profile....
Is there any hacks or tricks to do it? For example, i have 10 MT4 accounts & i want to send a "trade_open" command to all of em via an EA /dll/3rd party ways. Running 10 instances of MT4 terminal is foolish tbh. I know Manager api supports transferring/copying of trades across accounts, but i'm...
  [MT4] Limit orders (12   1 2)
Why is it that when I send a limit order in at market prices (e.g. current Ask for a Buy-limit) it only fills on the next tick or after - never instantly. 
Good evening at all. Can anyone tell me why when I go to test this indicator in the STRATEGY TESTER, do not you draw me on the charts? Thanks to all the boys in the community
Hi at all! What's syntax for create a note for a method ??? If it's exist... FOR EXAMPLE: "int value = 1; //this variable =1" when i write code, in list of variables, when select "value", MetaEditor view: "this variable =1" There's a way for create a method description? Visibile when i call this...
After downloading history data, when we press refresh button, journal displays a message "xxx" bars downloaded. Can anyone explain what is happening behind the scene? Does it mean that history data had gaps and refresh button brings in additional data to fill in the gap? And if so where that is...
I really want to release my EA into the wild soon but I need user feedback on the UI and the properties menu. I cant test all the different combinations that people would possibly prefer so I made a free version available to the MQL4 community to just go wild with in exchange would you post on here...
Hi everyone,  I need to compare elements in an array with the last element.  I am trying to compare a current swing high, with previous swing highs that occurred periods ago, and stored in an array. This is in a bid to identify swing high points that occur on the same price zone.  All the while I'm...
Hi I am trying to write an EA based on the Binary destroyer but to trade forex. My problem is that no matter what I do the EA is not placing trades. It compiles correctly and loads as an EA but it is not executing trades in strategy tester or in my demo account. I am getting no errors in the expert...
Is there any function under MQL what we can insert into Expert Advisor or Indicator which refresh the current chart screen every 60 second without logoff and login or restart Meta Trader?
Hi guys! Context: I am currently using past data to do some profound analysis (Just started out using SQL) and of course using excel. Problem: Specifically, I am looking at NZD retail sales. It is clear that some years it is at 00:45 and other years at 01:45 ... and I am looking at summer months so...