Author: Copyright � 2014 Serkov Alexandr
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
Notches
#property copyright "Copyright © 2014 Serkov Alexandr"
#property link      "serkov-alexandr@mail.ru"
//================================== properties
#property indicator_chart_window
#property indicator_buffers 4

#property indicator_color1 Black
#property indicator_color2 Red
#property indicator_color3 Black
#property indicator_color4 Red

#property indicator_width1 3
#property indicator_width2 3
#property indicator_width3 3
#property indicator_width4 3

#property indicator_style1 0
#property indicator_style2 0
#property indicator_style3 0
#property indicator_style4 0

double     Buf1[];
double     Buf2[];
double     Buf3[];
double     Buf4[];
//=============================== initialization
int init()
  {SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);   
   SetIndexStyle(3,DRAW_LINE);     
   SetIndexDrawBegin(1,1);
   IndicatorDigits(Digits+1);
   SetIndexBuffer(0,Buf1);
   SetIndexBuffer(1,Buf2);
   SetIndexBuffer(2,Buf3);   
   SetIndexBuffer(3,Buf4);  
   return(0);}
//=============================== main function
int start()
  {int i,x=0,y=0;
  
   for(i=Bars-10; i>-1; i--)
   {
   if(High[i]>High[i+1])
   {if(x==1)
   {Buf1[i]=High[i];Buf1[i+1]=High[i+1];x=2;}
   else
   {Buf3[i]=High[i];Buf3[i+1]=High[i+1];x=1;}}
   
   
   if(Low[i]<Low[i+1])
   {if(y==1)
   {Buf2[i]=Low[i];Buf2[i+1]=Low[i+1];y=2;}
   else
   {Buf4[i]=Low[i];Buf4[i+1]=Low[i+1];y=1;}}    
   }

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