Download MetaTrader 5

MQL4 and MetaTrader 4 - page 98

To post a new topic, please log in or register
Hi All,   I dont know if im having a dim moment and over looking something really simple. Im not a big time MQL coder got into this quite recently but am pretty skilled in VBA.   Ive build my own EA using some Custom Indicators but these indicators could use some improving so stripped them down to...
I am a new coder in MQL4.   I am working on an EA that will delete all pending orders after a single pending BuyStop or SellStop order is executed and changed to a Buy or Sell. My results are mixed, it seems it is working if the Sell Stop is executed to a Sell, the Buy Stop is deleted. However, if a...
If I run the EA on 1 chart, 1 currency eg:AUDUSD only, it identifies the Ordersymbol == Symbol() , When I run the same EA on another chart with another currrency attached Eg:EURUSD on the same MT4 platform (2 currencies running on seperate charts) it returns "false" Ordersymbol doesnt equal...
Hi, i need a help.... This is my first EA and i am a beginner... can anyone help me to put Trailing stop for my EA ... i tried many ways but trailing stop is not activating when i am putting it on strategy tester... please help... this is my full EA(based on CCI for H4 and Daily TF, preferably...
Hi Experts, i need know when the last minute of day is running in my EA. It's for backtesting years of DAX-Index in order to close some postions at end of day. Usually it's always the same time hour=21 && minute=59. But unfortunately during years it has been changed in the DAX-Index often and my...
Today I restarted my Laptop after about a month ago. Now I get an error on starting MT4: "Fehler beim Erzeugen eines leeren Dokuments". (in english: failed to create empty document). I got Windows 7 x64. MetaTrader worked perfectly till today. After the Failure, MetaTrader is open, except the Chart...
Is there a function for this dashed line between opening and closing arrow of one trade?
Hello I want to know how to calculate the initial negative profit immediately after opening a position. Is it just a function of spread and lotsize? Or there are something else that must be considered//?  Please tell me the formula for calculating this.   thanks 
How to calculate the minute elapsed since opening a position Can this be true: if(TimeMinute(TimeCurrent())-TimeMinute(opentime)>60) { .... }    
Hello,   I was wondering if anyone had any example code for opening trades during certain days.  I'd like to only open trades Sunday (when market opens) until Thursday.  If the trades are profitable by Friday, I'd like to close them out.  I'd like to do this to eliminate gap risk over the weekends....
Hi, I'm hoping someone can me please? I have been writing in mql4 a dashboard for my trading strategy, I have about 20 pairs open as well, and the dashboard provides a central place to report various information. I have coded a button (I'm using rectangle label) and passing the chart ID by a click...
Hi there, I was wondering if there is any way to view the stop loss amount in a new order by currency instead of by pips? It is now often totally unclear to me how much I will lose or win when setting a new order. Is there a setting for this? Or a tool? Thanks in advance, Johan
Hi,  I´m assuming this question came a lot but I couldnt find anythin helpful.. Currently My ea works like: if(OrdersTotal()==0){ placing order ... etc .. }  The problem with the code above is, that it stops trading as soon as one order is open regardless of the conditions to open a new order. So...
Hi Everyone, Backtesting an EA and have noticed some incredibly strange profit results: Long trade is trailed out 4 pips above the entry price but results in a $67 loss Commission charge is only .7 pips, so should still be a 3.3 pip profit. Account is in USD and lot size .21 = $2.10 / pip. Any...
Hi guys, I am developing an EA and one of the exit strategies is when the RSI flats out. For example: http://d.stockcharts.com/school/data/media/chart_school/technical_indicators_and_overlays/relative_strength_in/rsi-2-rsplot.png Look at between 3 and 5. The peak becomes flat. In these moments, I...
  mediate the price (13   1 2)
Hello everyone,I explain this problem now ... how should I do to open a position, in the same direction of the first position, only after another loses for example 100 pips?I do not take the stoploss, I just need to open a position that you will close to target or if it goes back again to 100 pips I...
G'day everyone,  I was wondering if it is possible to get a notification of a trade occurring via my Apple Watch?  Thanks in advance for any answers. 
I'm new to MT4. When I save a profile, such as EURUSD with three different time charts, then open another profile such as AUDUSD with three different time charts, I now have all 6 on my display. It seems to me that I should be able to change profiles and not pile up charts into one view.  What am I...
Hi, Is it correct that live the time of MqlTick does not show fractals - the last one from Friday doesn't show any? Fractals would mean that each new tick would have a different timestamp (fractal) than the previous one, while otherwise several ticks within the same second would have the same...
does higher time frame has more control points than lower time frame in optimization?
I have a live account with tradersway.com and I want to open and use two MT4 accounts at the same time with different account numbers on the monitor.  Please let me know how I can do this.  
Hi I'm new in Mql4. I'm trying to create an ea based on the choppy market indicator. I've identified the buffers as follows:    double cma=iCustom(NULL, 0, "CMI",60,10,false,3, 1);//smoothed ma    double cmil = iCustom(NULL,0, "CMI", 60,10, false,0,1); //cmi line    double cmilg=iCustom(NULL,0,...
Hi guys, I'm trying to place a short order via OrderSend but I get error #130. Since I'm a noob in MQL development I'm sure you can solve this issue really fast. :P So here's the code snippet: double takeProfitTotal = NormalizeDouble(Ask-(TakeProfit*Point),Digits); double stopLossTotal =...
Is there any way to execute a code on an external event instead of executing thre code on every tick? For example when a .txt file in MQL/Files folder gets refreshed.   The idea is to send information/quotes to MT4 by an external (e.g. Java coded) program. This (Java coded) program creates/refreshes...
i have  subscribe in signal Small to big money please how i can changing lot size to 0.02 or 0,03 thank you very match 
Hello, Can anyone please add a stop loss based on pips for this script. This script launches multiple orders simultaneously Set manually s stop loss of 40-50 pips when we execute this indicator. Able to set a stop loss for EUR/USD order 40 pips Able to set a stop loss for EUR/GBP order 50 pips Able...
Hi guys  I wish to have the MT4 to have the prices update when the market is closed (weekend) so I can test EAs immediately while I am coding them without backtest. The data prices obviously are random or past data. Does anyone know of  way to do that  or a plugin that allows that?    Thank you
Hi,  I am new to MQL4, I haven't had a problem coding lotsizes based on a fixed amount of pips but cannot seem to make it work where I am calculating the lots size base on entry and stoploss levels. Please advise... Code is below...  void EnterTrade(int TypeOfTrade){    err=0;    double Equity =...
Peter Williams
  Invalid stops error 130 (17   1 2)
I have been using XM brokers and appear to get Invalid Stops occurring more often tyhan elsewhere but in any event don't quite understand what factors can lead to this error  I read the following with WHRoeder's comments - interesting but don't don't think they apply to my circumstances  https://www...
Strange Discovery; I need Help! I discover today as I was trading using my hedging strategy that I could not place a pending order within my recovery gap again as the platform kept on saying invalid SL/TP. I sense there was a little volatility in the market then but even for like 1hrs after then,...