MQL4 and MetaTrader 4 - page 726

hi everybody.. I'm working on a simple EA,. I realized that my SL & TP keep on changing after testing it on demo.. Initially, I set input parameters , SL =10 pips, TP = 10 pips..but it keep on changing and appear on a trade SL =9 pips, TP = 11 pips/ SL =8 pips, TP = 12 pips/ SL =11 pips, TP = 9
New article MQL5 Cookbook: Processing of the TradeTransaction Event has been published at mql5.com: In this article I would like to introduce one of the ways to control trade events using the means of MQL5. I must mention that a few articles have already been dedicated to this topic. "Processing of...
Hi experts, I've searched the forum but didn't find any topic relevant to my question so here goes. Is there a way in MQL4 to check how long a pending order has been sitting in the system and has not been executed? This is more of a sanity check for me to verify the expiration time set for pending...
Hello, I  have just created EA and want to incorporate trailing stop. EA will be launched  for several pairs which have different trailing stop levels. How it is the best way to write that trailing stop script into ea which will operate differently for each pair differently? Is it  good way to do it...
I found a great indicator that tracks the daily performance in real time of all the currency pairs on my list. Its a great indicator, unfortunately I can only see the first 10 pairs. It would be very helpful if the indicator can be sorted in ascending order and maybe another one in descending order...
Hello, how can I get the highest and lowest price for the last 50 bars ? I'm new at mql and have no idea. 
Hi, I'm stuck and would appreciate some assistance... I'm trying to use iCustom in a EA.  I have to supply a shift as the last parameter of iCustom but I don't want to look at bars I've already processed.  I tried using the following: void OnTick()  {      int...
I am writing an EA and want the EA to draw a horizontal line at a specific price level that is entered through an external variable. I have looked at using the function e.g. SetLevelStyle(0,1,clrBlack); but it seems to require a SetIndexBuffer which stipulates an array. In my case I want a line on...
Can I use them interchangeably for the current pair?
I noticed that mostly when MT4 get started, the Adobe Flash Player is broken and it can reproduce all time again. (No Sound, sometimes not play movies, settings not accessable and so on) (Tested under Windows 8.1 64Bit with that bug. Under Win7 i have not tested, but there is the Filestructure a bit...
As we can attach an indicator to the chart using iCustom function from EA, my question is how can we remove that same indicator from the chart using code inside the EA? Or any way to reload the indicator on the chart from the EA code?
When I drop an updated EA onto the given chart, it has no way of determining a bias from the historical price action. Instead, it will have to then wait for a bias to form off of the new price action. I am wanting to get the bias on initialization so that there is no lag or missing of setups when I
I can't remember how to do this, but this snippet of code here: ...        if( H1_close > ema60 && ema21 >= H1_low )            {            TriggerBar = iTime(NULL,low,1);             H1_Buy_Touch = "H1 Buy Touch";             }... All I am wanting is rather than "H1_Buy_Touch = "H1 Buy Touch";"...
Hi Guys I am trying to adjust my EA to a 5 digit broker but can't get it done. I am using this code (see SRC below) to convert my Digits to a 5 digit broker but when I compile the code I get the following errors '.' - semicolon expected pips - struct or class type expected I really don't know what...
  functions and function calls  (15   1 2)
Hi I'm noob alert ! Backround subject: I'm learning about the changes since build 600+ after a long lapse in learning mql4 At best I was only intermediate beginner back then. Anyhow, specifically functions and function calls. First Question: ref: https://book.mql4.com/programm/samples I assume I...
//+------------------------------------------------------------------+//| 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...
[Deleted]
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
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, 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.12393
[Deleted]
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...