Forum

History ticks data in EA tester is very different from live ticks data from same broker

I am trying to find out why my EA doesn't work on live data. Here is what I found out: Left section is real live tick from demo account, whereas right section is the history tick from same demo account. The broker I am using is ActivTrades. First column in left section is datetime, seconds since

connection time is 268ms, is this normal?

Here is my connection to FXTM server in China. Is this delay normal? Can you please recommend a low latency broker? Thanks

What is the default folder for reading external csv file?

I understand MT5 can not write file to directories other than in its own sub directory for security reason. Here, I am trying to read a file. I am putting a csv file, "ssTestData.csv", to the folder "C:\Users\nick\AppData\Roaming\MetaQuotes\Terminal\158904DFD898D640E9B813D10F9EB397\Files\" in my

Why my live data has 10 points spread, whereas on the same day, the history data has 20 points spread?

On live data, the spread is about 10 points: However, one day later, when I test EA with the tick data on the same day, the spread is 20 points. Question: 1. Why history spread is twice the live spread? 2. Is there a way to set history spread? Thanks

Why my limit buy order is not triggered after the current price is above my limit buy trigger price?

this is my limit buy order, trigger price is 1.06845. Here is the current price, which is 1.06850, 5 points more than the limit buy trigger price. I submit this limit buy order at the open price of last 3rd bar and which is 1.06845. After that, the price goes down 15 points and my limit buy order

How to send a limit buy order in MT5?

I placed a limit buy order using following code: uint limitBuy( double amount, ulong magicNumber, double price, double tp, double sl) { printf ( "limit buying %G lot, at %G price, TP %G, SL %G" , amount, price, tp, sl); MqlTradeRequest request = { 0 }; request.action = TRADE_ACTION_DEAL ;

How to create a variable to point to double &close[] ?

int OnCalculate ( const int rates_total, // number of available bars in history at the current tick const int prev_calculated, // number of bars, calculated at previous tick const datetime &time[], const double &open[], const

Possible bug in combining two take profit price in limit buy order

I submit one limit order 1: Limit Buy: 2 lots at 1.08000, TP 1.08200 order 2: Limit Buy: 1 lot at 1.05000, TP 1.05200 After the limit prices of both above two orders triggered, server uses arithmetic mean to actually combine the take profit prices into one. I believe the mean method should be

What is the right way to detect a stop loss order triggered?

When stop loss is triggered, the following log is generated by MT5. 2015.04.10 16:22:14 Core 1 2015.01.19 11:35:29 stop loss triggered sell 1.00 EURUSD 1.15417 sl: 1.16217 tp: 1.15317 [#5 buy 1.00 EURUSD at 1.16217] This is exactly the info I need in EA, getting price volume, against which order

What will happen if I open a limit buy and limit sell order at the same time?

I open a limit sell order and limit buy order both with take profit 300 points above the one price. For example: Order 1: limit buy at 1.08000, take profit at 1.08300, no stop loss Order 2: limit sell at 1.08000, take profit at 1.07700, no stop loss What I expect is when the price oscillating