Hello,
Is there a function that counts the number of bars that is being shown on the current chart? Thank you.
[Deleted]
I just set deviation = 5, but my ea gets requoting 120 pips..;;
What is the problem?
like topic, I like the function like MT4, can view the graphics object while testing. thanks
Hi, i modified the MACD Sample ea, make's it buy or sell close when macd goes from <0 to >0, sell or buy close when macd goes from >0 to <0. bool CSampleExpert::LongClosed() { bool res=false; if (m_macd_previous> 0 && m_macd_current< 0 ) { //--- close position
Hey everyone,
I was thinking today if it is possible to build an indicator action library using the object oriented programming in mql5 ? Let me give an example:
Let's say I'm programming an EA that enters the market shortwhen the EMA trend of period 34 is smallerthan zero, and the MACD Signal...
I have a trailing stoploss EA that I use to just close positions. The code I have drops the SL price along with other info in the EA log. The issue I have is with the code I use to close the order. For some reason it makes it to the expressions as if the CPositionInfo::Select() and the
Hi. My idea is to modify a bit the EA called MACD Sample EA, in this way: i would like to reprogram the algorithm in the way that i can switch between many entry(and also exit and modify) strategies. In a concrete example: When in the code there is this piece (for short opening position) bool...
Hello,
Is it possible to use a DLL which is created with C#.NET with MT5? Or is C++ the only way to go.
Please advise.
Thanks!
It appears that my EA doesn't get informed through OnTrade() at the final "end-of-test"-deal or at least HistoryDealsTotal() does not get updated correctly .
Has anyone else observed this too?
I have found a workaround: call OnTrade() one more time myself as soon as I receive OnTester().
But "my...
Hi everyone,
I made a Expert that uses Pending Orders in MQL4, but I cannot delete pending orders in MQL5 Strategy Tester. Anyone had more success than me?
Here is the part in the source code...
Hi all,
i'm here after a lot of hours spent on my pc attempting to understand how the import of DLL works with structures.
Some months ago i've easily created a class to interface my EA with MySql server using libmysql.dll without finding any difficult, since all functions uses a common mysql...
(Build 306) int BarOfTheDay( datetime time) { MqlDateTime dt; TimeToStruct (time, dt); int min = dt.min + (dt.hour * 60 ); Print ( "min = " , min, " dt.min = " , dt.min, " dt.hour = " , dt.hour ); return min/ Period (); } Output: 2010.08.16 20:07:36 K_sStatisticsOfBars ( EURUSD ,M30) min
I am trying to create a quick class for timing particular sequences of code (loops and nested functions) to determine where all my cpu cycles are going. So far I have come up with this:
class DebugTimer{ datetime StartTime; datetime EndTime; bool running; public...
Because the SYMBOL_VOLUME_MAX is 5.0, I have to open two orders: a 5.0 lots sell order and a 4.7 lots at the same time.
When I use trade.PositionClose(_Symbol,3) to close the opened orders, I get the error:
failed instant buy 9.70 EURUSD at 1.16000 [Invalid volume]
How can I close both of these...
Hi Coders!
I'm working on to develop my own functions (DealsTrack(), GetVolume(), etc.) for my Expert Advisors.
Could somebody explain me the difference between the functions of the Deals (Ticket) and the Order (Ticket)? In MT4 there's only Order Ticket - it's clear.
If I see the Orders/Deals...
Hello, I am repeatedly encouterring following problem: When I try to backtest my multi-currency EA in Strategy Tester, it reports "No prices for symbol USDJPY", for instance, and it quits. I get it work only with the number of symbols reduced to four. Where is the problem? Is there a limitation to...
When I tested my EA I got this error. My championship's EA get this kind of comment too.
Hello,
I'm struggling with something stupid here, don't know what I'm doing wrong.
I want to trade one lot for every 10000 I have in my account. So if I have 15000 in my account, the lot traded should be 15000/10000, and that is 1.5 lots.
This worked in MQL4, but in MQL5 it won't work. I...
Hi.
How to obtain the order open price?
Ive tried this for see printed results
Print( OpenPrice",PositionGetDouble(POSITION_PRICE_OPEN), " Profit",PositionGetDouble(POSITION_PROFIT) );
it just return in the Journal:
OpenPrice()
Profit()
no values returned.
Some help?
Thx
hi all, i've wrote my first ea in mql5 language. i think it's ok, but in tester doesn't appened anything. metatrader5 doesn't help me with no-avaible visual mode. here my class and ea file: http://www.megaupload.com/?d=LLRFDSFI
please someone can help beginner?
many thanks
Problem in detecting New Bar ( Testing using Daily Data ). In the following code, the value of Old_Time is *always* has same the same value as New_Time. Any idea why it is so ? Thanks, Walter static datetime Old_Time; datetime New_Time[1]; bool IsNewBar=false; int
Hi there,
I have already written some EAs and I never had any problems, but now I want to test a simple strategy and I have a big problem with the ema cross. I have written it exactly as I did it everytime before, but nothing works.
There are different conditions which have to be complied to open...
It would be nice, if the HTML Help File would mention the OrderClose statement and its expression in MQL5
with a short examble.
Article "Moving from MQL4" did not mention that the OrderClose Statement is no longer possible.
Hey everyone,
Is it possible to put constraints in the strategy tester? For instance if I use an EMA cross strategy and the two input variables are:
Fast_EMA
Slow_EMA
It is obvious that the Fast_EMA value should always be smaller than the Slow_EMA value. At the moment I define...
Hi, By default, the SYMBOL_TRADE_EXEMODE on the EURUSD symbol is set to SYMBOL_TRADE_EXECUTION_INSTANT. I need to change it to SYMBOL_TRADE_EXECUTION_MARKET and I can't do that. I have tried with this: long myMarketExecution = SYMBOL_TRADE_EXECUTION_MARKET; bool symbolMarketExecution =
What' s with the random DLL ACCESS VIOLATION?
It cannot possibly be the DLLs written by Microsoft.
What's with MT5?
Attach my EA.
I have created my EA but I have problem, please can you help me!
Trading Strategy
1. I used an indicator called Moving Average (MA) with a period 50.
2. I want to place a Long trade when the MA is increasing upwards and the price is close above it and it to place a...
Hi all, I am new to MQL5 and have a devlopper profile. I have written & test a few EAs. But i am not sure on how to read the result as my financial background is weak. For now, i am focusing on ProfitFactor & SharpeRatio, is that the right method ? Which one of the following is best result:...
Is there a possibilyty to add pending order expiration date in the tester log file ? I have big doubt they are not respected..
Dear MQL5 Developers,
in MQL4 there is an annoying thing: every time I work with doubles, I have to use NormalizeDouble function to compare them, and before I set as parameter of a trading function.
Is it possible to use double variables without every time normalizing (for example compare them)...

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
If you do not have an account, please register
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.