correlation_v4

Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
correlation_v4
//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property  indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Aqua
double x[];
int sum=0;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(1);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,x);
   SetIndexDrawBegin(0,0);
   SetIndexLabel(0,"x");
   SetIndexShift(0,0);
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int j,time,t;
   time=GetTickCount();
   t=time%2;
   if(t==0){sum=sum+1;}
   if(t==1){sum=sum-1;}
   x[0]=sum;
   for(j=ArraySize(x)-1;j>=1;j--){x[j]=x[j-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 ---