_CandleVisual

Price Data Components
Series array that contains the highest prices of each barSeries array that contains open prices of each barSeries array that contains the lowest prices of each barSeries array that contains close prices for each bar
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
_CandleVisual
//+---------------------------------------------------------------------+
//|                                                   _CandleVisual.mq4 |
//|                                           Copyright © InVest0r 2010 |
//+---------------------------------------------------------------------+
#property indicator_separate_window
#property  indicator_buffers 8
#property  indicator_color1  Gold
#property  indicator_color2  Gold
#property  indicator_color3  Lime
#property  indicator_color4  Lime
#property  indicator_color5  Red
#property  indicator_color6  Red
#property  indicator_color7  Green
#property  indicator_color8  Green

double dnhlhi[],dnhllo[],uphlhi[],uphllo[];
double dnprhi[],dnprlo[],upprhi[],upprlo[];
double HO,OL,OC,CO; 
//+------------------------------------------------------------------+
//|                Ôóíêöèÿ èíèöèàëèçàöèè èíäèêàòîðà                  |
//+------------------------------------------------------------------+
int init() {
   SetIndexBuffer(0,dnhlhi);           
   SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
   SetIndexBuffer(1,dnhllo);  
   SetIndexStyle(1,DRAW_HISTOGRAM,0,2);
   SetIndexBuffer(2,uphlhi);      
   SetIndexStyle(2,DRAW_HISTOGRAM,0,2); 
   SetIndexBuffer(3,uphllo);      
   SetIndexStyle(3,DRAW_HISTOGRAM,0,2);    
   SetIndexBuffer(4,dnprhi);      
   SetIndexStyle(4,DRAW_HISTOGRAM,0,4);
   SetIndexBuffer(5,dnprlo);      
   SetIndexStyle(5,DRAW_HISTOGRAM,0,4); 
   SetIndexBuffer(6,upprhi);      
   SetIndexStyle(6,DRAW_HISTOGRAM,0,4);
   SetIndexBuffer(7,upprlo);      
   SetIndexStyle(7,DRAW_HISTOGRAM,0,4);                    
   return(0); }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit() {

   return(0); }   
//+------------------------------------------------------------------+
//|                Ôóíêöèÿ èíäèêàòîðà                                |
//+------------------------------------------------------------------+
int start() {
   for(int i=0; i<Bars; i++) {
        
   HO=(iHigh(NULL,0,i)-iOpen(NULL,0,i));
   OL=(iOpen(NULL,0,i)-iLow(NULL,0,i));
   OC=(iOpen(NULL,0,i)-iClose(NULL,0,i));
   CO=(iClose(NULL,0,i)-iOpen(NULL,0,i));
   
   if (iClose(NULL,0,i)>iOpen(NULL,0,i)) {
             uphlhi[i]=0+HO; uphllo[i]=0-OL; upprhi[i]=0+CO;
             dnhlhi[i]=0; dnhllo[i]=0;  dnprlo[i]=0; }
   if (iClose(NULL,0,i)<iOpen(NULL,0,i)) {
             dnhlhi[i]=0+HO; dnhllo[i]=0-OL; dnprlo[i]=0-OC; 
             uphlhi[i]=0; uphllo[i]=0; upprhi[i]=0; } 
   if (iClose(NULL,0,i)==iOpen(NULL,0,i)) {
             uphlhi[i]=0+HO; dnhllo[i]=0-OL;}                        
   }
   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 ---