Price Data Components
Miscellaneous
0
Views
0
Downloads
0
Favorites
AnotherInstr1
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern string Instr="GBPUSD";
extern int multistep=6;
extern bool mirror=false;
double OUT[];
int init()
{
//---- indicators
IndicatorShortName("AnotherInstr "+Instr);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,OUT);
//----
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int limit;
int counted_bars=IndicatorCounted();
limit=Bars-counted_bars;
for(int i=0; i<limit; i++){
int period=2;
double MA=0;
for (int j=1;j<=multistep;j++){
double anotherHi=iHigh(Instr,0,iHighest(Instr,0,MODE_HIGH,period,iBarShift(Instr,0,Time[i])));
double anotherLo=iLow(Instr,0,iLowest(Instr,0,MODE_LOW,period,iBarShift(Instr,0,Time[i])));
double anotherCl=iClose(Instr,0,iBarShift(Instr,0,Time[i]));
double anotherWidth=(anotherHi-anotherLo);
double Hi=iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,period,i));
double Lo=iLow(NULL,0,iLowest(NULL,0,MODE_LOW,period,i));
double Cl=iClose(NULL,0,i);
double Width=(Hi-Lo);
if (anotherWidth>0) double pos=(anotherCl-anotherLo)/anotherWidth; else pos=0;
if (mirror) MA=MA+(Hi-pos*Width); else MA=MA+(Lo+pos*Width);
period=period*2;
}//for
OUT[i]=MA/multistep;
}//for
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
---