Author: Copyright � 2005, MetaQuotes Software Corp.
at_Itp4
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
at_Itp4
//+------------------------------------------------------------------+
//|                                                    at_Itp(t).mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red

extern int hours=4;
extern int s=10;
extern int cb=1000;

double ci[];
//================================================
int init()
  {
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ci);
   return(0);
  }
//================================================
int start()
  {
//   int    counted_bars=IndicatorCounted();
int i,x,m,pt,aa,bb,cc;
//----------------------------
pt=hours*60/Period();
//-----------------------
for (m=0; m<=s; m++)
{
i=0;
while (i<=cb)
{
if (m==0) { ci[cb+pt]=Close[cb+pt]; ci[i]=Close[i]; ci[cb+2*pt]=Close[cb+2*pt];}
if (m!=0 & m!=s) { ci[i+pt]=0.5*(ci[i]+ci[i+2*pt]); ci[0]=0.5*(ci[0]+ci[pt]);  ci[cb+2*pt]=0.5*(ci[cb+2*pt]+ci[cb+pt]); } 
if (m==s) { aa=i; bb=i+pt; cc=i+2*pt;
for (x=i; x<=i+pt-1; x++)  {ci[x]=ci[aa]*((x-bb)*(x-cc))/((aa-bb)*(aa-cc))+ci[bb]*((x-aa)*(x-cc))/((bb-aa)*(bb-cc))+ci[cc]*((x-aa)*(x-bb))/((cc-aa)*(cc-bb));}
}

i=i+pt;
}
}
   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 ---