Linear Price Bar_v1

Author: Copyright � 2006, Keris2112
Linear Price Bar_v1
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Linear Price Bar_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                             Linear Price Bar.mq4 |
//|                                      Copyright © 2006, Keris2112 |
//|                                                             none |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Keris2112"
#property link      "none"

#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 Red


//---- buffers

double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_HISTOGRAM,EMPTY,3);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_HISTOGRAM,EMPTY,3);
   SetIndexBuffer(3,ExtMapBuffer4);
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
      
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int i;
   int UpDays, DownDays, NeutralDays;
   double BarH, BarL, BarC;
 
//---- 
   for(i=0; i<Bars; i++)
      {
      BarH = High[i]-Open[i];
      BarL = Low[i]-Open[i];
      BarC = Close[i]-Open[i];
      if(BarC>0) UpDays += 1;
         else if(BarC<0) DownDays +=1;
         else if(BarC==0) NeutralDays +=1;

      
      
      ExtMapBuffer1[i] = BarH;
      ExtMapBuffer2[i] = BarL;
//      SortBuffer1[i] = BarH;
//      SortBuffer2[i] = BarL;
      if(Close[i]>Open[i])
         {
         ExtMapBuffer3[i] = BarC;
         ExtMapBuffer4[i] = 0;
         }
         else
         {
         ExtMapBuffer3[i] = 0;
         ExtMapBuffer4[i] = BarC;
         }
         
 
      }

//----
   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 ---