round_value_v3

Author: Copyright � 2010, Korwin
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
round_value_v3
//+------------------------------------------------------------------+
//|                                                  round value.mq4 |
//|                                         Copyright © 2010, Korwin |
//|                                             korwin-kor@yandex.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Korwin"
#property link      "korwin-kor@yandex.ru"

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_style1 2
#property indicator_style2 2
#property indicator_style3 2
#property indicator_style4 2
#property indicator_style5 2
#property indicator_style6 2
#property indicator_style7 2
#property indicator_style8 2

#property indicator_color1 DimGray
#property indicator_color2 DimGray
#property indicator_color3 DimGray
#property indicator_color4 DimGray
#property indicator_color5 DimGray
#property indicator_color6 DimGray
#property indicator_color7 DimGray
#property indicator_color8 DimGray

extern double Øàã = 0.005;
extern int Äëèíà_ïðîðèñîâêè = 500;

double buf0[];
double buf1[];
double buf2[];
double buf3[];
double buf4[];
double buf5[];
double buf6[];
double buf7[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(8);
//---- drawing settings
   SetIndexStyle(0,DRAW_SECTION);
   SetIndexStyle(1,DRAW_SECTION);
   SetIndexStyle(2,DRAW_SECTION);
   
   SetIndexBuffer(1,buf0);
   SetIndexBuffer(2,buf1);
   SetIndexBuffer(3,buf2);
   
   SetIndexBuffer(0,buf3);
   SetIndexBuffer(4,buf4);     
   SetIndexBuffer(5,buf5);
   SetIndexBuffer(6,buf6);  
   SetIndexBuffer(7,buf7); 
   
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   SetIndexEmptyValue(2,0.0);
   
   SetIndexEmptyValue(3,0.0);
   SetIndexEmptyValue(4,0.0);
   SetIndexEmptyValue(5,0.0);
   SetIndexEmptyValue(6,0.0);
   SetIndexEmptyValue(7,0.0);
   return(0);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

   int i,pos;
   int counted_bars = IndicatorCounted();
   if(counted_bars < 0)  return(-1);
   if(counted_bars > 0)   counted_bars--;
   int limit = Bars - counted_bars;
   if(counted_bars==0) limit-=1+Äëèíà_ïðîðèñîâêè+1; 
   
   for(i=limit; i>=0; i--)
      {
       buf5[i]=NormalizeDouble(Close[0],2)+Øàã*3;
       buf3[i]=NormalizeDouble(Close[0],2)+Øàã*2;      
       buf0[i]=NormalizeDouble(Close[0],2)+Øàã;
       buf1[i]=NormalizeDouble(Close[0],2);
       buf2[i]=NormalizeDouble(Close[0],2)-Øàã;
       buf4[i]=NormalizeDouble(Close[0],2)-Øàã*2;
       buf6[i]=NormalizeDouble(Close[0],2)-Øàã*3;
       
       if(buf1[i]>Close[0]) buf7[i]=NormalizeDouble(Close[0],2)-Øàã*4;
       if(buf1[i]<Close[0]) buf7[i]=NormalizeDouble(Close[0],2)+Øàã*4;
      }
       
       buf0[Äëèíà_ïðîðèñîâêè+1]=0;
       buf1[Äëèíà_ïðîðèñîâêè+1]=0;
       buf2[Äëèíà_ïðîðèñîâêè+1]=0;
       buf3[Äëèíà_ïðîðèñîâêè+1]=0;
       buf4[Äëèíà_ïðîðèñîâêè+1]=0;
       buf5[Äëèíà_ïðîðèñîâêè+1]=0;
       buf6[Äëèíà_ïðîðèñîâêè+1]=0;
       buf7[Äëèíà_ïðîðèñîâêè+1]=0;
//----
   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 ---