Auto Trading Disable by Client

 

Hello,

I tried to create a very simple EA program for closing trade as follows :

 

#property copyright "Copyright 2019, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

 

#include <Trade\Trade.mqh>

CTrade trade;

 

void OnTick()

  {

      trade.PositionClose(Symbol());

  }


But I got the message 

CTrade::OrderSend:instant sell 0.01 position #436147760 EURUSD at 1.10811 [auto trading disabled by client]


Note : Current position : buy, 1 lot on EUR USD, and also marked the automated trading column when insert the program.

I tried this and that but problem still exist.

Can anyone help, thanks.

Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
A script for opening a grid of orders If you need to quickly open several pending orders (Buy Limit, Sell Limit, Buy Stop, Sell Stop) on a certain distance from the current price, this script will do all the routine for you! Allow AutoTrading before running the script. Usage: Run the script on a chart. Input Parameters: Language of messages...
 
Click the auto trade button to allow.
 
Rina007:

Use SRC button, please.


Reason: