strategy testererror : ERROR in send SELL_Generation: 131 - page 2

 
Mehrdad Shiri:

AT the same time it run by my laptop but my pc has this error. yesterday and so many day there was no error by running with my pc.

and some times there was this error on my pc. and after some another runing , the ea was work on strategy tester by my pc and work good.

with the same setting for each of them.

i can run it now by my laptop now. why my pc get this error now ? ( and yesterday was wok good .).,

--------------------------

is this maybe return to history ?

with thank's to all reply.

is there any idea about this error ?

 
Mehrdad Shiri:

with thank's to all reply.

is there any idea about this error ?

Yes there is,

But without the code that would be guessing.

Usually it's automatic lotsize function that set's lotsize to unrealistic value, which results in rejection of the order.

 
Marco vd Heijden:

Yes there is,

But without the code that would be guessing.

Usually it's automatic lotsize function that set's lotsize to unrealistic value, which results in rejection of the order.

thank you.

...
..
.
. 
         lot_step=MarketInfo(Symbol(),MODE_LOTSTEP);
         trade_vol=NormalizeDouble(ZARIB_LOT_sdti*lot_buy/lot_step,2)*lot_step;
         
         Comment("" 
                 ,"\n          trade_vol=",NormalizeDouble(trade_vol,7) 
                 ,"\n          ask_price=",NormalizeDouble(ask_price,7) 
                 ,"\n          Slippage=",NormalizeDouble(Slippage,7) 
                 ,"\n          SL_buy_Generation=",NormalizeDouble(SL_buy_Generation,7)
                 ,"\n          TP_buy_Generation=",NormalizeDouble(TP_buy_Generation,7) 
                 //,"\n          trade_vol=",NormalizeDouble(trade_vol,7)
                  ,"\n          lot_step=",NormalizeDouble(lot_step,7) 
                 ,"\n          ZARIB_LOT_sdti*lot_sell=",NormalizeDouble(ZARIB_LOT_sdti*lot_sell,7)
                 
                  ,"\n          TP_ORDERS_buy=",NormalizeDouble(TP_ORDERS_buy,7) 
                   ,"\n          TP_ORDERS_sell=",NormalizeDouble(TP_ORDERS_sell,7) 
   
                );
                
         int ORDER_BUY_Generation=OrderSend(Symbol(), OP_BUY, trade_vol, ask_price, Slippage,SL_buy_Generation,TP_buy_Generation,"J-Buy",Magic_buy_Generation,0,HotPink);
         if (ORDER_BUY_Generation < 0) { Print(" ERROR in send BUY_Generation: ", GetLastError());}
           else {Print("BUY_Generation Ordered successfully");}

as you can see in below picture :

i used any useful controlling function to check the error. vol is not zero. ( for check the order send i have  same as this for sell and for all place in code ).

above pic. for my pc.

is there another seems i must add or modify ?

 
Mehrdad Shiri:

thank you.

as you can see in below picture :

i used any useful controlling function to check the error. vol is not zero.

above pic. for my pc.

And what is the value of MODE_MINLOT ?
 
Alain Verleyen:
And what is the value of MODE_MINLOT ?

with a internal calculation in code : i start for any 2000 in balance with " 0.01 lot " .

i have this in the end of my code :

//+------------------------------------------------------------------+

/*
//--- extern variables
extern double ExtMaximumRisk=0.05;             // 5% by default
 
//--- calculate current volume
double CalculateVolume()
  {
   double lot_min =MarketInfo(Symbol(),MODE_MINLOT);
   double lot_max =MarketInfo(Symbol(),MODE_MAXLOT);
   double lot_step=MarketInfo(Symbol(),MODE_LOTSTEP);
   double contract=MarketInfo(Symbol(),MODE_LOTSIZE);
   double vol;
//--- check data
   if(lot_min<0 || lot_max<=0.0 || lot_step<=0.0) 
     {
      Print("CalculateVolume: invalid MarketInfo() results [",lot_min,",",lot_max,",",lot_step,"]");
      return(0);
     }
   if(AccountLeverage()<=0)
     {
      Print("CalculateVolume: invalid AccountLeverage() [",AccountLeverage(),"]");
      return(0);
     }
//--- basic formula
   vol=NormalizeDouble(AccountFreeMargin()*ExtMaximumRisk*AccountLeverage()/contract,2);
//--- additional calculation
//   ...
//--- check min, max and step
   vol=NormalizeDouble(vol/lot_step,0)*lot_step;
   if(vol<lot_min) vol=lot_min;
   if(vol>lot_max) vol=lot_max;
//---
   return(vol);
  }
*/

as you see i was think no need to check the minimum  ;-)   and comment them.

i control the balance to be grather than or equal 2000

is this necessary to check min lot in this condition ?

 
Mehrdad Shiri:

with a internal calculation in code : i start for any 2000 in balance with " 0.01 lot " .

i have this in the end of my code :

as you see i was think no need to check the minimum  ;-)   and comment them.

is this necessary ?

Your topic is like a guessing game, I don't have time to lost, if you want help you have to provide all relevant informations.

 
Alain Verleyen:

Your topic is like a guessing game, I don't have time to lost, if you want help you have to provide all relevant informations.

Marco vd Heijden 2016.09.15 17:50   FA

Yes there is,

But without the code that would be guessing.

Usually it's automatic lotsize function that set's lotsize to unrealistic value, which results in rejection of the order.

thank you. and for your time help the other.

problem solved.

-------------------------------------------------------------------------------------

   for past running my ea on strategy tester with my pc , i was login by my standard acc. ( min. lot=0.01 )

&

in the latest running my ea on strategy tester with my pc , i was login by my cent acc. ( min. lot=0.1 )

so ======> !

thank for your help.