Opening sell position in mql5

 

Hi all, I new to mql5 and having problem in opening trade. following is my code.

//+------------------------------------------------------------------+
//|                                                     SimpleEA.mq5 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

#include <trade\trade.mqh>
CTrade trade;

void OnTick()
{
   double Bid = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID), _Digits);
   double Balance = AccountInfoDouble(ACCOUNT_BALANCE);
   double Equity = AccountInfoDouble(ACCOUNT_EQUITY);
   
   trade.Sell(0.10, NULL, Bid, 0, (Bid - 100 * _Point), NULL);
}

following is strategy tester setting.

strategy tester setting

following are the messages in strategy tester visualization's journala tab.

Time Message
2017.12.12 23:10:21.899 MetaTester 5 started on 127.0.0.1:3000
2017.12.12 23:10:21.899 initialization finished
2017.12.12 23:10:21.957 login (build 1643)
2017.12.12 23:10:21.969 38520 bytes of account info loaded
2017.12.12 23:10:21.969 1482 bytes of tester parameters loaded
2017.12.12 23:10:21.969 188 bytes of input parameters loaded
2017.12.12 23:10:21.974 6521 bytes of symbols list loaded
2017.12.12 23:10:21.997 expert file added: Experts\SimpleEA.ex5. 43658 bytes loaded
2017.12.12 23:10:22.007 initial deposit 10000.00 USD, leverage 1:500
2017.12.12 23:10:22.014 successfully initialized
2017.12.12 23:10:22.014 48 Kb of total initialization data received
2017.12.12 23:10:22.014 Intel Core i5  M 540 @ 2.53GHz, 3889 MB
2017.12.12 23:10:22.355 debug version of 'SimpleEA.ex5', please recompile it
2017.12.12 23:10:22.376 EURUSD: symbol to be synchronized
2017.12.12 23:10:22.377 EURUSD: symbol synchronized, 3864 bytes of symbol info received
2017.12.12 23:10:22.390 EURUSD: history synchronization started
2017.12.12 23:10:22.392 EURUSD: load 27 bytes of history data to synchronize in 0:00:00.000
2017.12.12 23:10:22.392 EURUSD: history synchronized from 2016.10.31 to 2017.04.26
2017.12.12 23:10:22.517 EURUSD,M30: history cache allocated for 17005 bars and contains 2626 bars from 2016.10.31 00:00 to 2017.01.16 23:30
2017.12.12 23:10:22.517 EURUSD,M30: history begins from 2016.10.31 00:00
2017.12.12 23:10:22.531 EURUSD,M30 (AMPGlobalClearing-Demo-CQG): 1 minutes OHLC ticks generating
2017.12.12 23:10:22.531 EURUSD,M30: testing of Experts\SimpleEA.ex5 from 2017.01.17 00:00 to 2017.05.11 00:00 started
2017.12.12 23:14:33.822 final balance 10000.00 USD
2017.12.12 23:14:33.827 EURUSD,M30: 398028 ticks, 3351 bars generated. Environment synchronized in 0:00:00.343. Test passed in 0:04:11.536 (including ticks preprocessing 0:00:00.094).
2017.12.12 23:14:33.827 EURUSD,M30: total time from login to stop testing 0:04:11.879 (including 0:00:00.343 for history data synchronization)
2017.12.12 23:14:33.827 284 Mb memory used including 1.41 Mb of history data, 64 Mb of tick data
2017.12.12 23:14:33.842 log file "F:\MetaTrader 5 for backtest\Tester\Agent-127.0.0.1-3000\logs\20171212.log" written


the issue is that tester is not opening trade. please help.

 
salirazataqvi:

the issue is that tester is not opening trade. please help.

// true - not for trade by market-orders
bool IsBadFilling( const string Symb )
{
  return(!(SymbolInfoInteger(_Symbol, SYMBOL_FILLING_MODE) & (SYMBOL_FILLING_IOC | SYMBOL_FILLING_FOK)));
}

void OnTick()
{
  if (IsBadFilling(_Symbol))
  {
    Print("Change symbol " + _Symbol + " or server " + AccountInfoString(ACCOUNT_SERVER) + " for trade by market!");
    
    ExpertRemove();    
  }
}


Result

2017.12.05 00:00:00   Change symbol EURUSD or server AMPGlobalClearing-Demo-CQG for trade by market!
 

You can't trade EURUSD on AMP broker.

 
Alain Verleyen:

You can't trade EURUSD on AMP broker.

Tester.

Reason: