Download MetaTrader 5

MQL4 and MetaTrader 4 - page 302

To post a new topic, please log in or register
//+------------------------------------------------------------------+//| Expert tick function                                             |//+------------------------------------------------------------------+void OnTick() {  CheckHistory(); // This NEEDS to be checked every tick   if(...
Hi!   I have EA which has global variable [bool Trade=false;]. I need a function that would check if a line on chart has been crossed, it will enable trade [Trade=true;] , then 'wait' for 1 order to be opened (when trading conditions are met), and then disable the trade [Trade=false;]. Currently...
Testing Code and found OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES) does not change after selected ticket is closed. Anyone know the reason? extern int Ticket=0 ;//+------------------------------------------------------------------+//| expert initialization...
hello, my mt4 worked fine, but today after compiling my ea(during the tester was running), i cannot open the expert properties to modify the parameters( but i can still start the testing and generate results ) when i click the expert properties, the whole mt4 seems to freeze, i cant click any...
Hi, after I wasn't able to eliminate some differences I had closer look at iMaOnArray and I programmed a simple example. I created a buffer (sma(n)-sma(2n)) and let iMaOnArray create another sma(2) which I calculated my self too and displayed the result on the chart: 1) See the big difference of the...
Hi all , I have searched this site without success , i need a function that will give me the values of the default Heiken Ashi candles on MT4 platform. I need help with getting the value of the white candle and the red candle ? I am currently working on an EA that will buy on white Heiken Ashi...
Hi, I am trying to connect the mt4 as a Socket-Client to a waiting Socket-Serve: I can see the Socket-Server waiting for connection in Windows SysInternalsSuits\TCPView. I am using the example from here: https://www.mql5.com/en/code/9296. I found that several things have to be changed as the types...
The reference says for the Print function that "It enters a message in the Expert Advisor log. Parameters can be of any type." But, my "/MQL4/Logs" folder is empty. Where is the "expert advisor log"?
Hi all , Please how can i get the value of the last Fractals indicator arrow, whether up or down? . I am currently working on a code that will buy when the most recent(last visible) Fractals arrow is below the current price, and i want the code to sell when the value of the most recent (last...
Hi, I have downloaded MT4 into my PDA (OS: Windows) and tablet (OS: android) but I cannot draw trend line. For your information I really need trendline for analyzing Forex. Kindly do me a favour. TQ
Would you be so kind to help me about the following case?   Fibonacci retracement and the trendline functions would be very important for me on my android mt4, but I can't find it in the software.  Is there any possibibility to use it somehow on my andoid, or I have to change my new mobile to...
Hii all This is sreainvaas from india.I have stranded Mtf RSI AND CCI INDICATOR MT4.I want to convert this indicator as bar indicator.Please any body help me I also attach these indicator.   Thanking you in advanced      
Hi everyone, I'm quite new to Metatrader 4 and trading in general. Could someone help me answer this question please? - If I close or change (SL/TP) an open trade while the market is closed during the weekend, will ''the order'' take effect as soon as the market opens on Monday ? Thanks for your...
Hi, I realized that the mt4 built-in function iMaOnArray(..) seems not to update the average with the new ticks of the actual bar. It seem to calc. only at the beginning of the bar - quasi at open - and then the average is not updated each time a new tick arrives. Hmm  ???? So I wrote a little...
Helloeveryone, I'm using Meta Trader 4  and I'mwondering if there are anyway to plot an order from my account history on the chart. Becauseit will help me to improve my trade, and to review my technique.   Thankyou
I was looking at price on a weekly level and there are some really big moves.Is there an indicator that will show you the value between two points? The cross hairs give a meaning value .......GBPUSD 12271~=12.271 (to 3rd decimal point) 5 digit = 1227 pips = 12.2 cents 1.71828 1.59435 = 0...
Hi I have 2 questions regarding a practice EA I am coding. 1. A SELL position is not opened immediately after closing a BUY position. This results in the EA only having long or only short trades. What is the problem? 2. When the CurrentFastEMA = CurrentSlowEMA (unlikely, but it happens), the code...
I've just started to study MQL4 and I would like to ask some questions about event handlers in EAs. 1. Is OnInit the default handler for any EA ... that is, we should place all the codes in this event handler? 2. If we want to make trades on tick base, should we use OnTick event in place of OnInit?...
Hi,  I'm after an MT4 indicator that displays the current ATR value on the price chart without plotting the historical values? Just want to keep my template a little cleaner!! I'm sure it exists but haven't been able to track it down yet. Has anyone come across it?  Thanks, Phil 
New article Interaction between MеtaTrader 4 and MATLAB Engine (Virtual MATLAB Machine) is published: The article containsconsiderations regarding creation of a DLL library - wrapper that willenable the interaction of MetaTrader 4 and the MATLAB mathematicaldesktop package. It describes "pitfalls"...
Hi, I want to run my ea as following time. eg: 10,11,13,14,15,17,18,19,20 I tried following code, but i get error. hope i use user variable i defined something wrong. can you support me to resolve this issue? extern int HoursOpen = 1,2,3,4,5,6,7,8;    int datetime = TimeCurrent();    int hour0 =...
i use windows 7, MT4 in build 670 for a while. Since last Sunday i get the following error message when starting MT4: Metatrader has stopped working a problem caused the program to stop working correctly. Please close the program -> close the program When just closing the window then MT4 build 670...
Hi gurus, Can you show me a solution for that? I searched but couldn't find anything. For example: I have a button on a chart, and it opens a buy order when I click on it. Thx
Hi all,   I was wondering if anyone can help me with the issue on the subject above. The problem started when I was upgrading my MT4 platform from 670 built to 711 built as advised by my broker (Fxprimus). I was not able to open the new installed version. It ran fine on previous MT4 platform and...
  ibar shift (6)
Hi...I was hoping someone would know the answer to what I thought would be obvious  ;-) When I run in an Ea, Test 1 only,   Hrcnttot   increases according to my sendemail details received.  But if I run only test 2 or 3 , Hrcnttot  never changes....  I assume I have misunderstood the ilow shift ......
Hi, I have an array of Pointers like   Order* m_orders[] and there is a problem:  Order is a class containg informations about TP, SL, open time and so on. I want to sort this array by open time in a function but mql(4) accepts only arrays by reference as parameter so I can't do that. In C language...
Hey y'all,  I recently started working with MQL4 and I need some help with my code.  Although it runs and I can execute my EA, it doesn't work like it's supposed to.  Any help or tips wold be greatly appreciated.  The code is attached below:   EDIT: I've had some comments about what I mean by how it...
Hi,  I have the MT4 platform trading gold in gbp (XAUGBP). I am looking to get a live feed of the bid ask price into Excel. Can anyone help? Thank you very much  
after connected to broker server, mt4 crashed.   APPCRASH   app name: terminal.exe   app version: 4.0.0.711   timestamp: 008b4800   module name: StackHash_6537   module version: 0.0.0.0   module timestamp: 00000000   exception: c0000005   exception pos: 77488203   OS version: 6.1.7601.2.1.0.256.1
//--- global ---enum SelectTicket   {Order1=0,Order2=1,Order3=2,Order4=3};extern SelectTicket SelectOrder = Order4; How do I translate the above to correspond to the right TicketOrder()? I am wanting to be able to change the extern variable to say Order2, and then when a certain function is called....