Forum

Big Lesson on MQL5

I was converting my own indicator from MQL4 to MQL5 and while I'm pretty good at both standards, the result in MQL5 was wildly different. the culprit was some uninitialized local variables inside loops, that which worked well under MQL4 but crazy under MQL5. // Something like this in MQL4 will

MetaTrader you had one job - inconsistencies when backtesting (visual vs. non visual)

MetaTrader 5 produces different backtest results when you use exactly the same settings for the Visual Backtester and Non-Visual Backtester. When I use the Visual mode everything is normal and goes as expected, when I uncheck the visual mode hoping to get the same results but faster, this is what I

Why MT5 overrides general windows theme colors?

MT5 does not comply with the general theme colors after build 4570, as I mentioned here https://www.mql5.com/en/forum/448873#comment_54724820 before. As a Dark Theme user, seeing large white boxes kills my focus and hurts my eyes. for the comparison I attached the good old 4150 build that was

Is it memory-safe to call WndObj::Create() repeatedly without deleting the previous one?

I'm creating a Rectangle Label using the CHARTEVENT_MOUSE_MOVE event, for every time the event fires I invoke obj_rect_label.Create(foo, bar, lparam, dparam); my question is that, is this method safe in terms of memory management? or do I need to delete/destroy the previous object before recreating

How to use CWnd::Left() as Set Method

I'm unable to set any of the Left() / Right() for a certain CWnd instance. maybe Im wrong but I expect to change the dimensions of - for example - a CEdit object using these methods. could anyone provide an example for the use case? whenever I use CWnd::Left( 100 ) I can confirm that the output from

Inconsistent backtest results

Yet another quirk of MT5, with exactly the same conditions the visual tester does the job right while the non-visual tester opens a position when it shouldn't. I'm having a very deep look into this and there's no "randomness" in the code. - I tried all modeling methods (everytick, 1 min ohlc, etc..)

Keyboard navigation for Trade History

Does anyone knows how is it possible to use keyboard shortcuts to skip chart to the next/previous trade in history? I know I can double click on the specific order in the history panel but using keyboard is so much more productive when doing backtests . please share your Idea, including any method

Strategy Tester : open chart with expert loaded automatically (attached to the chart)

My EA adds some MTF indicators to the chart and in order to see them after the backtesting, I have to add the EA to the tester chart manually, everytime the backtester finishes testing. this manual loading taking me some amount of time for saving the backtest settings then loading them into the EA

[SOLVED] Accessing non-buffer arrays as timeseries

Im trying to get access to the dynamic array's elements as timeseries but I have no Idea what is wrong with my method, it just doesn't work and no amount of searching helped me. After I store values into the array for each bar that EA process, I want to read the last added element using index 0 . so

Proper usage of CTrade OrderOpen method

Im confused by the parameters of the CTrade OrderOpen method. I'm not sure how to to skip the "limit_price" parameter and send a simple pending order (not the buy_stop_limit kind for example) this is the way I'm sending a buy stop order and Im not sure If I'm doing it the right way. please do not