Download MetaTrader 5
To add comments, please log in or register
Deposit to your account via Visa QIWI Wallet
sheri_lanyue
17
sheri_lanyue 2016.04.09 13:55 

errors are shown in the picture, some functions are below:  

double getmin()
  {   
   double low;
   low=iLowest(NULL,0,MODE_LOW,20,0);//---20根K线最低价
   return(low);
  }
  double getmax()
  {
   double high;
   high=iHighest(NULL,0,MODE_LOW,20,0);//---20根K线最高价
   return(high);
  }


double myLots(double lot)
 {
  lot=NormalizeDouble(AccountEquity()/1000.00*(getmax()-getmin()),2);
  return(lot);
 } 
Files:
1.png 94 kb
Vladimir Karputov
Moderator
42463
Vladimir Karputov 2016.04.09 20:33  

The function myLot  should be passed double. I offer this design:

   .
   . 
   .
   double new_lot= 0.23 ;
   iOpenOrders( "Sell" ,myLots(new_lot), 50 , 80 );
   .
   .
   .
 void myLots( double &lot)
  {
   lot= NormalizeDouble ( AccountEquity ()/ 1000.00 *(getmax()-getmin()), 2 );
  }
/
To add comments, please log in or register