Forum

MT5 to MT4

Anyone willing to convert a program from mql5 to mql4

Simple EMA break and retest

Hello all, I’m trying to write an ea where when price breaks an EMA, and comes back to touch it again, I’m placing an order to anticipate a bounce. I’ve tried this but lots of trades are missed: Buy if previous candle low > previous EMA and current close <= current EMA The first part simulates a

Time period for Backtesting

Hello all, I am curious as to it is better to backtest over a longer period or shorter period. I know the obvious answer is longer period, but technical analysis likely develops over time, making the modern times more relevant. In the case of this image, is this sudden linear increase due to moving

Basic Entry for EA

Hello, I have been writing very basic stuff, and from this code I don't understand why not all the candles are accounted for. It should be the case that each candle is a new trade, but yet there are some gaps in dates aside from the weekend (according to my trade history and the visualization it is

Price crossing moving average

Hello all, I've been making a program so I can see what percent of the time a moving average cross (with price) gets faded and what percent of the time it is a breakout. This is purely based on the close of the next candle. Right now it appears that it is claiming every candle close is a breakout or

MqlDateTime

When I try to print the hours, minutes, and seconds, the minutes and seconds are fine but the hours just prints 1. MqlDateTime mtime; TimeToStruct ( TimeCurrent (),mtime); Print ( "mtime.hour = " ,mtime.hour); // outputs 1 Print ( "mtime.min = " ,mtime.min); // works correctly Print ( "mtime.sec

London Session opening time in MT5

Since MT5 is in GMT + 2 and London is GMT + 1, and London opens 8:00am local time , does that mean the time in MT5 will be 9:00am and GMT will be 7:00am

Determining time of day

I've looked into TimeCurrent() as well as CDatetime and I can't seem to figure out to determine the number of seconds elapsed in a day. I like TimeCurrent(), but I would prefer to have only the time without the date. I need to obtain the number of seconds elapsed as opposed to just the time as a

I could be wrong, but is closing a position supposed to immediately change the balance?

I could be wrong, but is closing a position supposed to immediately change the balance? Is something else at play, like the settlement period

Difficulty getting Cloud Agents to work

I read the information here: https://www.metatrader5.com/en/terminal/help/mql5cloud/mql5cloud_use and I am not able to get cloud agents to show that they are "processing." It only shows them as "ready." I have my account connected, with money in it, and have enabled the agents, but just can't get