Codes

Save OHLCV Data from Chart to CSV File for MetaTrader 5

This script saves all the OHLCV data available on the chart to a CSV file

Forum

The expert enters long on unexpected price

I have made a simple expert advisor with these specifications: It is based on double simple moving average cross, fast=9, slow=21. It should only enter positions on open price of new bars. To achieve this, the modeling type is "Open prices only". It uses the CTrade class to open and close positions

How to evaluate my EAs?

I have been learning MQL5 , and I have written some simple EAs. However, I have have the problem of evaluating my EAs. How to know if my EA is better than the average? When an EA is ready for demo forward-testing

Is it advisable to use the libraries in Expert path in mql5?

I was looking at the ExpertMAMA.mq5 file that is in Experts\Advisors, it includes these libraries: #include <Expert\Expert.mqh> #include <Expert\Signal\SignalMA.mqh> #include <Expert\Trailing\TrailingMA.mqh> #include <Expert\Money\MoneyNone.mqh> I was watching some tutorials and the only library

How to Get Histogram from MACD and Signal lines?

I successfully used the code below to get the last n values of MACD and Signal lines : CopyBuffer (handleMACD, 0 , n , inputBufferNumber, bufferMACD); CopyBuffer (handleMACD, 1 , n , inputBufferNumber, bufferSignal); However, I also need the Histogram line. How can I get the the last n values of the

Why am I failing to open short positions in mql5?

I have used this line of code to open a long positions, and it works well: trade.PositionOpen( _Symbol , ORDER_TYPE_BUY , 1.0 , SymbolInfoDouble ( _Symbol , SYMBOL_ASK ), 0 , 0 , NULL ); However, when I try the same thing with the short positions, no sell position is opened: trade.PositionOpen(