Miscellaneous
1
Views
0
Downloads
0
Favorites
# KeyLevels
//+------------------------------------------------------------------+
//| # KeyLevels.mq4 |
//| Copyright © 2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Modest"
#property link ""
#property indicator_buffers 8
#property indicator_chart_window
#property indicator_color1 Red
//---- buffers
double L20[];double L50[];double L80[];double L100[];
double L_20[];double L_50[];double L_80[]; double L_100[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(8);
SetIndexStyle(0,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); SetIndexStyle(2,DRAW_ARROW);
SetIndexStyle(3,DRAW_ARROW); SetIndexStyle(4,DRAW_ARROW); SetIndexStyle(5,DRAW_ARROW);
SetIndexStyle(6,DRAW_ARROW); SetIndexStyle(7,DRAW_ARROW);
SetIndexArrow(0, 0x9E);SetIndexArrow(1, 0x9E);SetIndexArrow(2, 0x9E);SetIndexArrow(3, 0x9E);
SetIndexArrow(4, 0x9E);SetIndexArrow(5, 0x9E);SetIndexArrow(6, 0x9E);SetIndexArrow(7, 0x9E);
SetIndexBuffer(0,L20);SetIndexBuffer(1,L50);SetIndexBuffer(2,L80);SetIndexBuffer(3,L100);
SetIndexBuffer(4,L_20);SetIndexBuffer(5,L_50);SetIndexBuffer(6,L_80);SetIndexBuffer(7,L_100);
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double RP;
int counted_bars=IndicatorCounted();
//----
int i = Bars - counted_bars - 1;
while (i>=0)
{
RP=Close[i]; RP=RP*100; RP=MathCeil(RP); RP=RP/100;
L20[i]=RP + Point*20;
L50[i]=RP + Point*50;
L80[i]=RP + Point*80;
L100[i]=RP + Point*100;
L_20[i]=RP - Point*20;
L_50[i]=RP - Point*50;
L_80[i]=RP - Point*80;
L_100[i]=RP - Point*100;
if (Symbol()=="EURJPY")
{
RP=Close[i]; RP=MathCeil(RP);
L20[i]=RP + Point*20;
L50[i]=RP + Point*50;
L80[i]=RP + Point*80;
L100[i]=RP + Point*100;
L_20[i]=RP - Point*20;
L_50[i]=RP - Point*50;
L_80[i]=RP - Point*80;
L_100[i]=RP - Point*100;
}
//if (i==0) Alert(Symbol());
//if (i==0)
// Alert(RP," ",L20[i]," ",L50[i]," ",L80[i]," ",L100[i]," ");
i--;
}
//----
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
---