Miscellaneous
0
Views
0
Downloads
0
Favorites
BidAskChannel
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Black
#property indicator_color2 Black
//---- indicator parameters
//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
int draw_begin;
string short_name;
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM,0,1,indicator_color1);
SetIndexStyle(1,DRAW_HISTOGRAM,0,1,indicator_color1);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- indicator short name
// SetIndexDrawBegin(0,draw_begin);
// SetIndexDrawBegin(0,draw_begin);
//---- indicator buffers mapping
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
// int i;
// for(i=0;i<Bars;i++)
// {
// ExtMapBuffer1[i]=Ask;
// ExtMapBuffer2[i]=Bid;
// }
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
//----
int i;
for(i=0;i<Bars-ExtCountedBars;i++)
{
ExtMapBuffer1[i]=High[i]+Ask-Bid;
ExtMapBuffer2[i]=Low[i];
}
//---- done
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
---