CandleBodyPrcnt

Author: Copyright � 2008, Ronald Verwer / Forex MetaSoft
CandleBodyPrcnt
0 Views
0 Downloads
0 Favorites
CandleBodyPrcnt
//+------------------------------------------------------------------+
//|                                              CandleBodyPrcnt.mq4 |
//|                 Copyright © 2008, Ronald Verwer / Forex MetaSoft |
//|                                     http://www.forexmetasoft.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Ronald Verwer / Forex MetaSoft"
#property link      "http://www.forexmetasoft.com"

int i;
double prcnt,OverAllPercent;

//+------------------------------------------------------------------+
//| script initialization function                                   |
//+------------------------------------------------------------------+

int init()
   {
   Comment("");
   }

//+------------------------------------------------------------------+
//| script execution function                                        |
//+------------------------------------------------------------------+

int start()
   {
   for(i=Bars;i>=0;i--)
      {
      if(High[i]-Low[i]>0)
         prcnt+=((MathAbs(Open[i]-Close[i]))/(High[i]-Low[i]))*100;
      }
   OverAllPercent=prcnt/(Bars+1);

   Comment("\nAverage Candle Body of the "+Symbol()+" currency pair is "+DoubleToStr(OverAllPercent,2)+"%");

   //return(0);
   }

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

Comments