Forum

"not enough money" on strategy tester (build 2361 - 08 Mar 2020)

My local MT5 installation was just updated to build 2361. After that, tests with my EA started failing on placing new orders, always with "not enough money" error. Why this is happening? The exact test with the same EA was working until yesterday, but now orders are being rejected on strategy tester

Specifying MT5 intallation to python package

I´m trying python package but got I problem right in the first line of my script. After importing the necessary packages I´m calling MT5Initialize(), but I have more than one MT5 installed in my computer and the one being loaded is not the one I would like. The docs mention a "path" argument, as

Performing WebRequests from behind corporate proxy

It seems that WebRequest ignores proxy configuration, event if configured both on MT5 and operating system. So, how to make http requests if the EA is running on a network with corporate proxy

Strategy Tester not accounting trade results

I have an EA that I already use both on demo and production accounts. The EA works as expected on those accounts. However, I´m having issues with strategy tester. On ST the trade results are not accounted. All the trades appear in the history tag with the correct entries and outs, but the financial

Bars being counted differently on backtests and on live account

Weird behavior here. CiLow.GetData( 0 , Bars ( _Symbol , _Period , initialTime, TimeCurrent () ), buffer ); The previous call, when run in back tests, returns a buffer with n elements, where the first of these elements is the low of bar at initialTime. However, the same call in a demo live account

Problems after upgrading to version 5.00 build 1629 (14 jul 2017)

After accepting MT5 advice to upgrade to version 5.00 build 1629 (14 jul 2017) my bot stopped working. Compilation goes fine, but, after a successful order execution , HistoryOrdersTotal() now returns zero instead of 1, that was the correct behavior of previous MT5 versions. Anyone else experiencing

How partial order executions are notified to the EA?

Suppose a situation where the EA places an order with lot 2. If this order is partially executed then a full execution should produce two deals. The first one is notified in the OnTrade() method as being related to an order with status ORDER_STATE_PARTIAL . What about the second one? Will it be

How to use trade events with CExpert?

CExpert has some event handler methods, namely TradeEventPositionOpened, TradeEventPositionVolumeChanged, TradeEventPositionModified, among others. The question is: when these methods are called? Taking TradeEventPositionOpened as example, in my tests this method is never called, even when the EA

Partial TPs using base classes

I'm using standard library 's base classes for creating an EA. After opening a new position, I'd like to post some pending orders for partial TPs, as well as a stop order. The doubt is what is the more elegant way of doing this using the standard library's base classes? At this moment I just coded a

Can´t get deal price

This is my code: double openPosition( double price ) { MqlTradeRequest mrequest = { 0 }; MqlTradeResult mresult; mrequest.action = TRADE_ACTION_PENDING ; mrequest.price = price; mrequest.symbol = _Symbol ; mrequest.volume = this .lot;