Forum

Where do you prefer to put SL and TP in expert advisors - Ask or Bid?

I need some opinions about this. Lets take a BUY trade for example, we know that it is opened at Ask price. Then, the question is where to put SL and TP if we want them to be 10 pips, and why ? SL should be at: Ask - 10 pips Bid - 10 pips TP should be at: Ask + 10 pips Bid + 10 pips What about

I need few people to benchmark this MQL4 Script

Hey there. I'm doing some benchmarks and I wonder what will be the result for other people. Can you try the script below and tell me the time returned for f1(), f2() and f3()? void OnInit () { int i, t0, count = 10000000 ; //-- t0 = GetTickCount (); for (i= 0 ; i<count; i++) {

MT4 crashes on the newest Windows 10 Build 9879

terminal.exe (745) on MetaTrader 4 does not start at all. I think the problem started after I updated Windows Technical Preview to Build 9879. Before, there were situations when MT4 started slowly. Also, when it worked before, it sometimes forget the login data, so I needed to register a new demo

How to get the last known (modified) SL and TP from a closed position (history order) correctly?

I found some old topic with the same problem, but it was not resolved: https://www.mql5.com/en/forum/4387 It looks that this issue is pretty old. Ok, here is what to do: 1. Open position without stops, SL = 0 and TP = 0 2. Modify stops. SL => X and TP => Y 3. Close that position 4. Try to get SL

Arrows of trades are shifted (has wrong time property) in backtest

I searched for this, but without success. Let's say that the search mechanism here is not as capable as Google :) MetaTrader 4 build 625 (and 628 as well) in portable mode (and normal mode as well). Windows 8.1. Here is the code, it's as simple as that: void OnInit () { int success = OrderSend (

MT4 runs EAs ridiculously slow. Someone knows why?

Here is the very simple code that I used to benchmark how fast is MT4 when working with EA functions: int i= 0 ; int max= 15000000 ; int t0= 0 ; int init() { //-- test 1 t0= GetTickCount (); for (i= 0 ; i<max; i++) { int a= 1 + 2 ; } Print ( "test 1: " +( GetTickCount ()-t0)+ "ms" );

How to know the last modify price of a trade?

We know OrderOpenPrice() and OrderClosePrice() (which is Bid in case of Buy trade and Ask in case of Sell trade), but I can't find an option to know the last price when a trade was modified - let's call it OrderModifyPrice(). Well, MQL4 is pretty old now and it's possible that I'm missing something

Is OrderSend() function now able to send ECN trades (with SL and TP) by itself?

I have tested it on two brokers where I can manually open a new trade as "Market Execution" with "Stop Loss" and "Take Profit" options disabled. That's expected, but in fact, when I create an EA, OrderSend() function works when SL and TP parameters are used. It just opens trades as in non-ECN