Simpe SellLimit script dont work

 

Simpe SellLimit script dont work - EURUSD

Work fine in Advisor. But dont work in Script.


   #include <Trade\Trade.mqh>   
   CTrade         m_trade;

void OnStart()
  { 

   MqlRates rates_old[];
   ArraySetAsSeries(rates_old, true);
   int bars = CopyRates(Symbol(), PERIOD_D1, 0, 10, rates_old);
   double today = rates_old[0].high;            
   m_trade.SellLimit(  1,today,Symbol(),0,0,ORDER_TIME_GTC,0,"Limit Added" );

   }

 

Do this:

***
m_trade.SetTypeFillingBySymbol(Symbol());
m_trade.SellLimit(1.0,today,Symbol());
Print("SellLimit -> ",m_trade.ResultRetcodeDescription());
***
Reason: