[MT4指标]直盘USD指标策略
#property copyright "Copyright  2009, sHrung."
#property link      "http://www.something.com/"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 AliceBlue
//---- input parameters
extern int MomPeriod=1000;
//---- buffers
//--- currencies 
double USD;
//--- 
double ac_gbpusd, ac_eurusd, ac_usdjpy;
double ac_usdchf;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
   //---- additional buffers used for counting.
  IndicatorBuffers(5);
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,USD);
   SetIndexBuffer(1,ac_gbpusd);
   SetIndexBuffer(2,ac_eurusd);
   SetIndexBuffer(3,ac_usdchf);
   SetIndexBuffer(4,ac_usdjpy);
   
   
   
//---- name for DataWindow and indicator subwindow label
   short_name="Accu/Dist Graph USD ("+MomPeriod+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,"USD");
//----
   SetIndexDrawBegin(0,MomPeriod);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Four legs                                                        |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
   int a, b, c, d, e, f, g, h, ii, j;
//----
   if(Bars<=MomPeriod) return(0);
//---- initial zero
   if(counted_bars<1)
      for(i=1;i<=MomPeriod;i++) USD[Bars-i]=0.0;
//----
   int limia=Bars-counted_bars;
   if(counted_bars>1) limia++;
   for(a=0; a1) limib++;
   for(b=0; b1) limic++;
   for(c=0; c1) limid++;
   for(d=0; d1) limik++;
   for(i=0; i=MomPeriod) i=Bars-counted_bars-1;
   while(i>=0)
     {
USD = ac_usdjpy + ac_usdchf - ac_gbpusd - ac_eurusd ;
    i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+     










