Indicators Used
0
Views
0
Downloads
0
Favorites
VTS_VG_G1
//+------------------------------------------------------------------+
//| VTS.mq4 |
//| IZZY |
//| |
//+------------------------------------------------------------------+
#property copyright "IZZY"
#property link ""
#define MAXBARSCOUNT 15000
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Aqua
#property indicator_color2 Magenta
#property indicator_color3 Aqua
#property indicator_color4 Magenta
#property indicator_color5 Aqua
#property indicator_color6 Magenta
#property indicator_color7 Aqua
#property indicator_color8 Magenta
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
//extern int Sb = 300;
extern int PeriodAtr = 10;
extern double kATR = 2.0;
double VTS[MAXBARSCOUNT];
double VTS1[MAXBARSCOUNT];
double VTS2[MAXBARSCOUNT];
double VTS3[MAXBARSCOUNT];
double VTS4[MAXBARSCOUNT];
double VTS5[MAXBARSCOUNT];
double VTS6[MAXBARSCOUNT];
double VTS7[MAXBARSCOUNT];
int init()
{
//---- indicators
IndicatorBuffers(8);
SetIndexBuffer(0, VTS);
SetIndexBuffer(1, VTS1);
SetIndexBuffer(2, VTS2);
SetIndexBuffer(3, VTS3);
SetIndexBuffer(4, VTS4);
SetIndexBuffer(5, VTS5);
SetIndexBuffer(6, VTS6);
SetIndexBuffer(7, VTS7);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
int StartBars = Bars - counted_bars+2;
//if (StartBars<Sb) StartBars = Sb;
for(int i = StartBars; i>=0; i--){
VTS[i] = (Close[i]-kATR*iATR(NULL,0,PeriodAtr,i));
VTS1[i]= (Close[i]+kATR*iATR(NULL,0,PeriodAtr,i));
}
for(i = StartBars-1; i>0; i--){
VTS2[i]= MathMax(VTS[i],VTS[i+1]);
VTS3[i]= MathMin(VTS1[i],VTS1[i+1]);
VTS4[i]= MathMax(VTS2[i],VTS2[i+1]);//VTS2[i+1];
VTS5[i]= MathMin(VTS3[i],VTS3[i+1]);//VTS3[i+1];
VTS6[i]= MathMax(VTS4[i],VTS4[i+1]);//VTS4[i+1];
VTS7[i]= MathMin(VTS5[i],VTS5[i+1]);//VTS5[i+1];
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---