Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
OscSAR
//+------------------------------------------------------------------+
//| OscSAR.mq4 |
//| Copyright © 2010, LeMan. |
//| b-market@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, LeMan."
#property link "b-market@mail.ru"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
//----
extern double Step = 0.02;
extern double Maximum = 0.2;
//----
double OscBuffer[];
//+------------------------------------------------------------------+
int init() {
string short_name;
//----
IndicatorDigits(Digits);
//----
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, OscBuffer);
//----
SetIndexDrawBegin(0, 14);
//----
short_name = "OscSAR (" + Step + "," + Maximum + ") ";
IndicatorShortName(short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
int start() {
int i, limit, counted_bars = IndicatorCounted();
//----
if (Bars < 3) {
return(0);
}
//----
if (counted_bars > 0) {
counted_bars--;
}
limit = Bars - counted_bars - 1;
for (i = limit; i >= 0; i--) {
OscBuffer[i] = Close[i] - iSAR(NULL, 0, Step, Maximum, 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
---