Navigation´╝ÜHome > Content >

Speedometer_Lines.mq4

Time: 2017-11-23 | Download file:Speedometer_Lines.mq4

//+------------------------------------------------------------------+
//|                      Currency __power indicator retranslated.mq4 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "???"
#property link      "www.???.com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Green
#property indicator_color3 Red

 
double blue[];
double green[];
double red[];



int init() {
  

  if (ObjectType("lbl") !=23) ObjectDelete("lbl");
  if (ObjectFind("lbl") ==-1) ObjectCreate("lbl", OBJ_LABEL,0, Time[5], Close[5]);
  ObjectSetText("lbl", "SPEED OF TRADE  @ CASTALUNA ",Magenta);
  ObjectSet("lbl", OBJPROP_FONTSIZE, 12);
  ObjectSet("lbl", OBJPROP_XDISTANCE,5);
  ObjectSet("lbl", OBJPROP_YDISTANCE, 20);
  SetIndexStyle (0,DRAW_LINE);
  SetIndexBuffer(0,blue);
  
  SetIndexStyle (1,DRAW_LINE);
  SetIndexBuffer(1,green);
 
  SetIndexStyle (2,DRAW_LINE);
  SetIndexBuffer(2,red);
  
  
  IndicatorShortName("SOT");

   return(0);
}

int deinit () 
{
    ObjectDelete("lbl");
    return (0);
    }


int start() {
                                                                                
   
   if (ObjectType("lbl") !=23) ObjectDelete("lbl");
  if (ObjectFind("lbl") ==-1) ObjectCreate("lbl", OBJ_LABEL,0, Time[5], Close[5]);
  ObjectSetText("lbl", "SPEED OF TRADE @ CASTALUNA", Magenta);
  ObjectSet("lbl", OBJPROP_FONTSIZE, 12);
  ObjectSet("lbl", OBJPROP_XDISTANCE,5);
  ObjectSet("lbl", OBJPROP_YDISTANCE, 20);
  double pnow;
   double p1, p2, p3, p4, p5, p6, p7, p8, p9,p10;
   double SOT,SOT1,SOT2,SOT3,SOT4,SOT5,SOT6,SOT7,SOT8,SOT9,SOT10;
   double SOTAV10;
   double SOTAV2;
  for (int i=0;  i < Bars; i++) {
      blue[i] =0;
         green[i] =0;
         red[i] =0;
         
         
         
         // current price Close and Open
   double OpenPricenow = Open [i];
   double ClosePricenow = Close [i];
   double Volumenow = Volume [i];
   
   // candle 1
   double OpenPrice1 = Open [i+1];
   double ClosePrice1 = Close [i+1];
   double Volume1    = Volume [i+1];
   
   
   // candle 2
   double OpenPrice2 = Open [i+2];
   double ClosePrice2 = Close [i+2];
   double Volume2     = Volume [i+2];
   
   
   
   
   // candle 3
   double OpenPrice3 = Open [i+3];
   double ClosePrice3 = Close [i+3];
   double Volume3     = Volume [i+3];
   
   // candle 4
   
   double OpenPrice4 = Open [i+4];
   double ClosePrice4 = Close [i+4];
   double Volume4     = Volume [i+4];
   
   
   
   //  candle 5
   
   double OpenPrice5 = Open [i+5];
   double ClosePrice5 = Close [i+5];
   double Volume5    = Volume [i+5];
   
   
   //  candle 6
   
   double OpenPrice6 = Open [i+6];
   double ClosePrice6 = Close [i+6];
   double Volume6   =  Volume [i+6];
   
   
   //  candle 7 
   
   double OpenPrice7 = Open [i+7];
   double ClosePrice7 = Close [i+7];
   double Volume7    = Volume [i+7];
   
   
   //  candle 8 
   
   double OpenPrice8 = Open [i+8];
   double ClosePrice8 = Close [i+8];
   double Volume8    = Volume [i+8];
   
   
   // candle 9
   
   double OpenPrice9 = Open [i+9];
   double ClosePrice9 = Close [i+9];
   double Volume9  = Volume [i+9];
   
   
   // candle 10
   
   double OpenPrice10 = Open [i+10];
   double ClosePrice10 = Close [i+10];
   double Volume10  = Volume  [i+10];
   
   
   
   
   pnow = (ClosePricenow - OpenPricenow); 
   SOT  =  (pnow / Volumenow)*10000;
   
   
   p1 = (ClosePrice1 - OpenPrice1);
   SOT1= (p1 / Volume1) *10000;
   
   
   p2 = (ClosePrice2 - OpenPrice2);
   SOT2 = (p2 / Volume2) *10000;
   
   
   p3 = (ClosePrice3 - OpenPrice3);
   SOT3 = (p3 / Volume3) *10000;
   
   
   p4 = (ClosePrice4 - OpenPrice4);
   SOT4= (p4 / Volume4) *10000;
   
   
   p5 = (ClosePrice5 - OpenPrice5);
   SOT5 = (p5 / Volume5) *10000;
   
   
   p6 = (ClosePrice6 - OpenPrice6);
   SOT6 = (p6 / Volume6) *10000;
   
   
   p7 = (ClosePrice7 - OpenPrice7);
   SOT7 = (p7 / Volume7) *10000;
   
   
   p8 = (ClosePrice8 - OpenPrice8);
   SOT8 = (p8 / Volume8) *10000;
   
   
   p9 = (ClosePrice9 - OpenPrice9);
   SOT9 = (p9 / Volume9) *10000;
   
   p10 = (ClosePrice10 - OpenPrice10);
   SOT10 = (p10 / Volume10) *10000;
   
   SOTAV10 = (SOT+SOT1+SOT2+SOT3+SOT4+SOT5/100*6);
    
   SOTAV2 = (SOTAV10*2);
         
         
            blue[i] = SOT;
       green[i] =SOTAV2;
       red[i] = SOTAV10;  
         
       }  
       return(0);

  }

Recommend