Forum

Limit order backtesting

Forgive me if this is totally obvious to the rest of you: My experts using limit orders, never seem to take any trades at all on MT4. Is this is a known limitation? I can't find anything to suggest limit orders are not supported in backtesting , but grateful for any insight. Luck to all

Alert at end or start of bar

I'm sending myself alerts on certain new bars, when two of my custom functions return a 1 for example, but it seems there's some slowness or lag causing the custom functions to respond to the previous bars value... I want to send the alert 20 or seconds after the new bar has started. What is the

Programatically adjust Y scale on chart

Is it possible in code to adjust the vertical scale on a chart? To be sure, what I mean is, hold the mouse button on the scale and move the mouse forward or backwards. Thanks and good luck all

Terminal resolution

In my MT4 terminal I can see in the chartXX.chr files that I have ca 1800 width and 960 or so height. This is on macbook 16 with an insane resolution, but I'm not forcing MT4 into the high resolution mode as everything becomes too small. Q: Is there a way to pull out this resolution in code in MT4

Comment text lines overlap

I set up a new VM with MT4 and on this when I use Comment ("something") the lines are overlapping, e.g. below. I have a workaround which is to change Windows 10 trying to "fix" blurry displays. It does make the RDP session look very crisp and lovely, *but*, MT4 ends up looking garbled as per this

EA (and indicator) use old version despite new compile

A bit of a weird issue here. I write a lot of EA's and indicators, and I compile all the time of course. Sometimes, I apply the EA and indicators to a chart using a template. Now what I see is that the previous version of said code is running, until I hit recompile - until I apply the template that

Anticipate news and close trades with EA

The problem: Programatically exit trades, downsize, or just not trade that [morning|day|evening] before major news events, e.g. interest rate announcements and such. General question - is anyone familiar with / aware of a free or cheap financial news service where the schedule of news releases is

Rules framework

So my current project has become quite, uh, webbed... In a bad way. I'm finding it problematic to define trade rules in a consistent and consolidated way, and if I step away for too long I find it hard to identify sometimes why a trade was opened or close, although my logging is pretty good. Is

Detecting back test

I am writing some files for state persistence, but this is not needed when back testing. What code or environment variable (or similar) can we use in the EA, so it knows when it's being executed by a backtest

Extract info about how an order was closed

I am looking for a way in MT4 to programatically know how an order was closed, e.g. did the EA close it or was it a human/manually instigated operation. Is this available? I've looked at all the Order* commands, nothing seem to fit this requirement