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

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---