Forum

Different values from Moving Average indicator and its value plotted in the chart

Hi everybody, I'm taking my first steps in MQL5, in particular I'm testing the moving average indicator. I wrote the following lines of code to print the moving average value as soon as I receive a new H1 candle (with period "14", calculated on H1 timeframe, with mode EMA and on PRICE_CLOSE). static

Specify an absolute path in FileOpen function

Hi everybody, I've read the MQL5 documentation about FileOpen function and in the examples it's always specified a relative path (starting from c:\Program Files\MetaTrader 5 Terminal\Tester\Agent-127.0.0.1-3000\MQL5\Files\ folder). Do you know if it is possible to specify an absolute file path and

Get now timestamp during backtest

Hi everybody, I need to get the current datetime in a string, possibly in a SQL format (e.g. 2019-04-07 15:37:02). I've tried three methods of MQL5 standard library: TimeCurrent TimeGMT TimeLocal but during backtest they all return the same date that is not the actual date. I need to get the