//+------------------------------------------------------------------+
//|                                         しょぼしょぼサンプル.mq4 |
//|                                             sakymns test program |
//|                                            http://fxde.tou3.com/ |
//|                                              最終更新日2011/07/21|
//|                                                      とりあえず。|
//+------------------------------------------------------------------+

#property copyright "sakymns test program"
#property link      "http://fxde.tou3.com/"
#define MAGIC 20110721           //MAGICナンバー

bool orderok = true;
bool newdaycheck = true;
bool itidome = true;
bool flag = true;
double yesterdayAccountB = 0.0;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----


//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
//----
   //日付が違っていたら。
   //GMT等考慮していないので時間は自身で変えてください
   if (TimeDay(Time[1]) != TimeDay(Time[0]))
   {
      if (itidome == true)
      {
         newdaycheck = true;
         itidome = false;
      }
   }
   else
   {
      newdaycheck = false;
      itidome = true;
      flag = true;
   }

   if(newdaycheck == true && flag == true)
   {
      if (AccountBalance() < yesterdayAccountB)
      {
         orderok = false;
      }
      else
      {
         orderok = true;
      }
      yesterdayAccountB = AccountBalance();
      flag = false;
   }


      //(ry
   if(orderok == true)
   {


   }
}