And there's more....
NRTR WATR-hist.mq4
//+------------------------------------------------------------------+ //| NRTR WATR.mq4 | //| | //| Ramdass - Conversion only | //+------------------------------------------------------------------+ #property
indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Tomato #property indicator_color2 DeepSkyBlue //---- input parameters extern int AveragePeriod=10; extern int Variant=2; extern int CountBars=300; //---- buffers double value1[]; double value2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicator line IndicatorBuffers(4); SetIndexStyle(0,DRAW_HISTOGRAM,0,2);//SetIndexStyle(0,DRAW_ARROW); //SetIndexArrow(0,167); SetIndexStyle(1,DRAW_HISTOGRAM,0,2);//SetIndexStyle(1,DRAW_ARROW); //SetIndexArrow(1,167); SetIndexStyle(2,DRAW_HISTOGRAM,0,2); SetIndexStyle(3,DRAW_HISTOGRAM,0,2); SetIndexBuffer(0,value1); SetIndexBuffer(1,value2); //---- //---- return(0); }
//+------------------------------------------------------------------+ //| NRTR WATR | //+------------------------------------------------------------------+ int start() { if (CountBars>=Bars) CountBars=Bars - AveragePeriod - 2; // CountBars = CountBars - AveragePeriod - 3; SetIndexDrawBegin(0,Bars-CountBars+1); SetIndexDrawBegin(1,Bars-CountBars+1); int i,i2,bar,counted_bars=IndicatorCounted(); double value,WATR; double trend=1,dK,AvgRange,price,AveragePeriod_D; AveragePeriod_D=AveragePeriod; //---- if(Bars<=AveragePeriod) return(0); //---- initial zero if(counted_bars<1) { for(i=1;i<=AveragePeriod;i++) value1=0.0; for(i=1;i=1; i--) { dK = 1+(AveragePeriod_D-i)/AveragePeriod_D;
AvgRange=AvgRange + dK*MathAbs(High-Low); } if (Symbol()=="USDJPY" || Symbol()=="GBPJPY" || Symbol()=="EURJPY") {WATR = AvgRange/AveragePeriod_D/100;} else {WATR = AvgRange/AveragePeriod_D;} } if (Variant == 1) { for (i=1; i Open[CountBars-1]) { value1[CountBars - 1] = Close[CountBars - 1] * (1 - WATR); trend = 1; value2[CountBars - 1] = 0.0; } if (Close[CountBars-1] =0) { value1=0.0; value2=0.0; if (Variant == 3) { AvgRange=0;
for (i=1; i price) price = Close; value = price * (1 - WATR); if (Close < value) { price = Close; value = price * (1 + WATR); trend = -1; } } if (trend == -1) { if (Close value) { price = Close; value = price * (1 - WATR); trend = 1; } } if (trend == 1) {value1=Low; value2=High;}//if (trend == 1) {value1=value; value2=0.0;} if (trend == -1) {value2=Low;
value1=High;}//if (trend == -1) {value2=value; value1=0.0;} bar--; } return(0); } //+------------------------------------------------------------------+ NRTR WATR.mq4 //+------------------------------------------------------------------+ //| NRTR WATR.mq4 | //| | //| Ramdass - Conversion only | //+------------------------------------------------------------------+ #property indicator_chart_window #property indicator_buffers 2
#property indicator_color1 Blue #property indicator_color2 Red //---- input parameters extern int AveragePeriod=10; extern int Variant=2; extern int CountBars=300; //---- buffers double value1[]; double value2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicator line IndicatorBuffers(2); SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,167); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,167); SetIndexBuffer(0,value1); SetIndexBuffer(1,value2); //---- //---- return(0); } //+------------------------------------------------------------------+ //|
That's it for now, sorry about the posts but the this forum doesn't allow more than 10000 characters at a time.
Fred,
I'm not sure if I understand, you have the code, if you put them into the metatrader indicators folder, then you will have the indicator. Or have I missed something?
I will be happy to upload the indicators if you need them, the code will be the same.
Thanks Foreverold. I'm still new at Metatrader so didn't know about the folder option, you have helped a lot.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use