Download MetaTrader 5

MQL4 and MetaTrader 4 - page 17

To post a new topic, please log in or register
Hi, I know this question must be already asked earlier but i am not really able to find the proper code for the same. I need the close price for a specific time in history. I do understand that i can get it via iClose[] function. All i need is the working code for getting bars since that time in...
How to turn positive number to negative number vice versa? I created indicator when EUR is down it means the USD is up, I computed the price in EUR/USD.
Hi, I need to know if it’s possible to assign a different sell order to the respective buy order. Ex: first buy order was executed and a second buy order was executed at a different bid than the first buy order. I want to assign two different  sell order for my respective buy order. Thank you in...
Hello, i have this problem Running ten Mt4 platforms on a Windows Server 2012R2 VPS, the platforms locks and stop responding. A friend of mine told me that he had the same problem on a WS2012 VPS and don't have the problem with the WS2008 VPS. Did someone noticed my same problem in the Windos Server...
Hi All, I came across an old script (by a user called Hanover) that allowed you to take a FXT history file and output an ASCII readable file displaying the header record and any number of tick records you choose.  However the MT4 I am running is Version 4 Build 1090 so I need to modify the code to...
This is a very good indicator. The arrow of this indicator appears in the old candle when the new candle is opened and not painted again. I want the arrow to appear earlier in the old candlestick and it may disappear when the candle is closed for manual trading. Can anybody help me with adding code...
I've got a subclass of CObject, which will plot a trend line on the chart. At some point the end point of the line has to be changed (I know how to do that part). However, I have to find the line object, which up until now, I did by looping over all chart objects looking for a string tag I put in...
Are there indicator or script to showing the calendar days (Saturday & Sunday) as an empty candle or empty space into MT4? Thanks in advanced.
Hello, I need to check in runtime, what is the license type of the EA. In MQL4 terms. If it is free, demo, paid(full), or time trial. I need to check this, because my program is mainly designed to work in a tester mode, and it will have a paid version with more features unlocked. This is a question...
Hi, I have a horizontal line that shows a price. I want to put a text on this line but for some reason, I only see the beginning of my text on the right of my chart. How can I see the whole text? Thanks! ObjectCreate("price",OBJ_HLINE,0,0,price);ObjectSet("price",OBJPROP_PRICE1,price);...
I've created 2 custom classes that need to be able to hold a reference to an instance of the other's class. They've been created with the MQL4 class template. I broke them down to the basics. Candle class: #include <Arrays/ArrayObj.mqh> #include "MyTrade.mqh" class MyCandle: public CObject { public:...
Hallo, please an help. I have backtested and optimized an EA fortwo weeks. Of course it launched sell and buy orders in backtesting stage. Now that it is running in real time on theEuroUsd currency,, it does not launch orders, neither on my pc , nor on avirtual server running 24 hours, although...
Hi, I have been trying to make a new order in my demo account in PFG FX Trade but the "New Order" button is all grey and nothing happens when I click it. I have already tried restarting the computer, uninstalling then reinstalling PFG FX Trader and after I login, I still cant make a new order....
Hello there, The title pretty much says it all. I have the following code (I use similar code to add other things to the chart):- void CArrow::_createArrow(datetime time1,double price1)  {   if(_arrowUp)     {      price1-=(_config.ArrowUpOffset*Point());     }   else     {      price1+=(_config...
Hello everyone, I am very confused about what exactly swap means. I found this bit on Google   "A swap/rollover fee is charged when you keep a position open overnight. A forex swap is the interest rate differential between the two currencies of the pair you are trading, and it is calculated...
Hi All I have an OrderSend working on previous Hour Candle at 06:00 Problem i have is that OrderSend is using the last 06:00 which is one day ago? Anyone able to point me in the right direction to read documentation how to fix. Look forward to any replies. Merry Christmas. J
Hello everyone, I have two demo accounts at the moment in which I test my EA's.  I don't want both the EA's to be capable of being enabled on both accounts. Can I use a conditional compilation to prevent this from happening? If it possible, please elaborate on steps to achieve this.
Hello everyone, I would like my EA to close the orders at CROSSING moving averages, simply. But I can not find the "formula" that can perform this function. However, I tried a lot of solutions, such as: if (Ask <= (ma5 (1) <ma8 (1) && ma5 (0)> ma8 (0))) ..... CloseAll (); etc ... and many others,...
  pip-based timeframe (14   1 2)
how would you code a chart that is based on pips and not on time, but on pips: acandle closes when you've had 10 pips up or 10 pips down. So candles(/bars) arebased on price and not on time. Doesn't seem like a simple coding thing so anyhelp would be much appreciated
Does anyone know how to get a second 'Fibobacci Retracement' tool, into the MT4 Tool bar. I have changed my Fib tool to draw 'Entry, Stop Loss and Take profit'. However it is slow process to convert the Fib tool back to its proper use. If I could have a second Fib tool, I could leave it with the...
  Arrow Spacing (3)
Hi All, Can anyone tell me how to space out arrows so they aren't directly on the top/bottom of a candle? Below is my source code along with a screenshot attached of how they currently look. #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Green #property...
Hi everyone, Why does ObjectFind() never find my object?? Thanks! #property strictdouble t_SL[1];int OnInit()  {   t_SL[0]= Bid;     ObjectCreate("t_SL"+IntegerToString(0),OBJ_HLINE,0,0,t_SL[0]);   ObjectSet("t_SL"+IntegerToString(0),OBJPROP_PRICE1,t_SL[0]);...
I'm working on a MA cross over EA and adding features here and there. One thing I have been trying to do is detect events where the moving averages cross while a bar is open, then uncross before bar close -- a fakeout. I am having a lot of trouble trying to figure out how to detect these events...
Hello, I have a problem which is quite simple but drives me crazy : i'm trying to calculate Profits shown in my Backtest (USD) with the amounts of pips and the lot , here's the formula pips * lots * (MarketInfo(pair, MODE_TICKVALUE)/ MarketInfo(pair, MODE_TICKSIZE)) the values are : 0.0030 points...
  Chart Clones (38   1 2 3 4)
This indicator will draw price charts as a subwindow. It has some MT limitations which I could not over come. One is the drawing or rather the sizing of the candles donot stay in step with the MT charts This indicator was writen to work with the charts as I look at charts. If you like to look at...
HI, I have been trying to put together my first self made EA I ahve been able to solve the 1st issue with stochastic now its the candle wick length. I want to instruct the EA to only take trades when the upper wick is greater than or equal to 20pips for a sell and the lower wick is greater than or...
Hi all,  I've written some "if" functions that delete a stop_order if the price goes past the high/low of the applicable candle in these three bar signals. However, if you take a look at the screen shot below, the sellstop  order at 1.11737 has deleted incorrectly just before it would have entered...
Hi all, I created a simple indicator as the difference between the Stoch(5.3.3) and his signal line. //---- indicator settings#property  indicator_separate_window#property  indicator_buffers 1#property  indicator_color1  PowderBlue#property  indicator_width1  2//---- indicator...
Hello, please can someone help me? Am just new in coding .. I tried to Modify 2 open orders at the same time,(I have 2 tickets with different Magic, one is for buy and one for sell), but order select dont work for me Errors like: invalid ticket for OrderModify function Modify of Buy cant be succees,...
Hello, I'm attempting to get my advisor to draws its technical analysis on the chart in real time. When I use ObjectSet to change parameters that would otherwise change the shape and size of the object, the changes are not being updated on the chart. In the code that draws prices from the technical...