MQL4 and MetaTrader 4 - page 223

To post a new topic, please log in or register
Hi everyone, I'm Max. I am a neophyte in the MQL4 programming and speak little English, so excuse me. I have a problem I can not solve. I have an indicator / alert built on CCI Histogram. I inserted the conditions that work. I would like that the last bar of the histogram, was read at the opening...
Hello, I have compiled a script without any errors for a graphical object (see attached file 'research grafobjects.txt'). But the graphical object is not visible on the graph I load it on. My journal displays messages that 1) it loaded successfully the script on graph, and 2) it was removed (the...
How to setup 2 or correlated pair in chart m t4
Closing by order sequence. How to create a loop to check? if i.e. order 1 + order 2 has profited - close order 3 + order 4 has profited - close 5 + 6 7 + 8 9 + 10 and so on ... Order 1 being having the smallest order number and was opened at the earliest time.
A couple of years ago I had this working and got side tracked and in that process somewhere lost the old code.  Trying to get this to work again but not having any luck and I don't know this language well enough to sort it out. Also not really finding much in the way of working examples. I know I...
Hello everyone, I need your help :) When I introduce indicators that I bought on graphs, the graph is erased and I have the following error message: UNINIT reason ... 4 (see the attached photo) Is anyone have an idea of the problem ?  Thanks you very much,   Stéphane 
I've been having some issues with custom indicator coding that I didn't have before. I write the code and it compiles normally, but when I try to attach the indicator to the chart the indicator doesn't appear on the security window...  Here's an example of code that I copied from the MT4 book that...
Hi guys, I started experimenting with a new piece of code that closes orders if the macd reaches the max of its values since 20bars(for example-if the order is buy) and reaches the min for a sell order. It is a function I wrote it looks like: this is the array i use:double macdarray[20];and int...
may we use global variables pass infomation between MT4 and MT5 terminal ? if we can ,if it will cause mistakes ? thanks .
hi everyone,        i m new to this forum. m trading for last 6 month. living in Australia. and one friend of mine is trading for me in my account from other country with different time zone. throughout the day i watch his trading in my account in my laptop. but sometime i m sleeping then i cant see...
Hi forum, I am using the following lotsize calculation: double moneyRisk = AccountBalance()*percentRisk*0.01;double lotSize  = moneyRisk / (entry-sl)*dir / (MarketInfo(NULL, MODE_TICKVALUE)/MarketInfo(NULL, MODE_TICKSIZE));lotSize  = MathFloor(lotSize/MarketInfo(NULL, MODE_LOTSTEP))*MarketInfo(NULL,...
Hi Coders, I would like to know the position of the Bid price relative to the TRIANGLE object. Whether is it inside a TRIANGLE or not? Do you have a simple idea for it? Thank you in advance. Relative
I have aclass that I use to check for a new bar. I initiate a timer in OnInit with theiTime function.  Then in OnTick I checkto see if the timer still corresponds with the time of the current bar. YesterdayI noticed a weird behavior in the Strategy Tester (ST), which doesn’t happen inreal trading...
Hi,   I am having problems with my code, I am personally opening 1 trade at a time per EA window but i have been told that numerous trades open for other people. Currently i have this code here:  in start() double stoplevel=MarketInfo(Symbol(),MODE_STOPLEVEL); double stoplevel=MarketInfo(Symbol()...
 Am looking for code to turn TP into a Trailstop when it is reached.  What are you looking for ? 
Hi, Is it possible to make an indicator which would calculate profit/loss of possible trades done by EA? I don't want it to show the real balance but something like the balance graph in strategy tester. Basically EA would buy and sell without actually placing any orders, calculate the profit/loss of...
Hey fellas, is there any option to tell MT4 only to connect to a specific server? I have read some posts on various forums about this issue. My Broker offers me 4 different servers, but i would like to use only one specific. Aftere a reconnect MT4 always changes the server. best regards
Good morning  i wanna know how to export automatically real time  data from excel to MT4  Trader   
Hi I'm trying to create a spreadsheet in Excel 2010 that displays the High Low Open Close for EUR/USD each day for one year. I've tried using DDE in MT4 but can only seem to get the High and Lows from that. Does anyone have an idea as to how I should go about this? If not with MT4 and DDE then where...
I know how to limit the number of trades in a candle. However, what I am trying to do is limit the number of trades between 2 points based on price levels.  I define a price level as an input, which serves as my buy price.... If my buy price level for EURUSD is 1.1150, I enter a buy order once the...
<Advertising removed>
Hi,   I'm currently having troubles with replicating the equation used by ObjectGetValueByShift. I think I'm having trouble getting the algebra correctly. I've been using this site as a source; https://www.mathsisfun.com/algebra/line-equation-point-slope.html , but I can't wrap my head around it....
Hi guys. Since I started using MT4,after I download something with utorrent,the MT changes the connection status speed to around 200/2 kb and when I try to place an order,it shows me the "No connection" error.To make it work again properly,I must uninstall and install again the MT4, but after I use...
Hello people!! Why some programmers put the "!" before a function ?? example: !isPositionOpen() and isPositionOpen() What do the different "!" ??   thanks for help! =]
hi guys im triing to open orders if a spwcified prices between highs and lows is reached, but the ea does not open orders. the findentry and buyconditionis called every tick, can someone help me to get this snall snippet working? ist there maybe a problem with the speed of the whole program, i have...
hello, i like to know where the platform take the data when i use iMA function? i delete all my ex4/mq4/mqh files from the platform, but when i call the iMA function from new indicator its still working... where the data is comeing from?  tnx  
New article Graphical Interfaces I: Functions for the Form Buttons and Deleting Interface Elements (Chapter 4) has been published on mql5.com: This article is the continuation of the first part of the series about graphical interfaces. The first article Graphical Interfaces I: Preparation of the...
  Histogram buffers (19   1 2)
Can someone please confirm how histogram buffers are used when writing custom indicators? I have already created an indicator that draws a line on the chart window. I now want to add histogram markers above and below the line in two different colours(green above, and red below, for instance). Can...
Hi all.    I'm using next code lines to attempt change bid line color but it doesn't change color. although ask line is working fine.   Can you help me. Thank you  ChartSetInteger(NULL, CHART_SHOW_ASK_LINE, True);ChartSetInteger(NULL, CHART_SHOW_BID_LINE, True); ChartSetInteger(NULL,...
how can i convert a double value to a integer value?