(Req) 2 ma crossover histogram indicator - page 5

To add comments, please log in or register
PJ
41
PJ  
mrtools:

Hello Josurf, made this one.

Hi mrtools,

Nice indicator you have made.

Can you please make a histogram indicator which shows pip size vertical bars being crossed by Moving Average (single)? 

Attached is the picture and range indicator.

Thank you

PJ
41
PJ  

Hi mrtools

Attached are the picture and the indicator . 

Another indicator is attached. I am not able to open it. I just located from Google. It contains errors and I am not able to load it.

If you think the indicator is useful please make it workable.

Thank you . 

PJ
41
PJ  

Hi mrtools,

The coder has used the bottom range_mod indicator to code it differently to include threshold line.

 

---------------------------- 

//---- indicator settings 

#property  indicator_separate_window 

#property  indicator_buffers 2 

#property  indicator_color1  Red 

#property  indicator_color2  Green 


//---- indicator buffers 

double     RANGEBuffer[]; 

double     RANGEBuffer1[]; 


//---- indicator parameters  

//extern int   Threshold=20; 

extern color CurrentBarColor = White; 

extern color ThresholdColor  = Aqua; 


//+------------------------------------------------------------------+ 

//| Custom indicator initialization function                         | 

//+------------------------------------------------------------------+ 

int init() 

  { 


//---- drawing settings 

   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,4); 

   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4); 

//---- indicator buffers mapping 

   SetIndexBuffer(0,RANGEBuffer); 

   SetIndexBuffer(1,RANGEBuffer1);  

//---- name for DataWindow and indicator subwindow label 

   IndicatorShortName("RANGE"); 

   SetIndexLabel(0,"RANGE"); 

   SetIndexLabel(1,"RANGE"); 


//---- initialization done 

   return(0); 

  } 

int deinit() 

   ObjectDelete("CurrentBarValue"); 

   ObjectDelete("LabelCurrentBarValue");  

}  

//+------------------------------------------------------------------+ 

//| Range                                                            | 

//+------------------------------------------------------------------+ 

int start() 

  { 

  double HighVal,LowVal,Threshold;


   int limit; 

   int counted_bars=IndicatorCounted(); 

//---- last counted bar will be recounted 

  if(counted_bars>0) counted_bars--; 

  limit=Bars-counted_bars; 

//---- RANGE counted in the 1-st buffer 

   for(int i=0; i<limit; i++) 

   { 

  

  HighVal  = iHigh(NULL,0,i);        

  LowVal   = iLow(NULL,0,i); 

  double Hi1 = iHigh(NULL,0,i+1);

  double Low1 = iLow(NULL,0,i+1); 

  double Hi2 = iHigh(NULL,0,i+2);

  double Low2 = iLow(NULL,0,i+2);

  double Hi3 = iHigh(NULL,0,i+3);

  double Low3 = iLow(NULL,0,i+3);

  double Hi4 = iHigh(NULL,0,i+4);

  double Low4 = iLow(NULL,0,i+4);

  double Hi5 = iHigh(NULL,0,i+5);

  double Low5 = iLow(NULL,0,i+5);

  double Hi6 = iHigh(NULL,0,i+6);

  double Low6 = iLow(NULL,0,i+6);

  double Hi7 = iHigh(NULL,0,i+7);

  double Low7 = iLow(NULL,0,i+7);

  double Hi8 = iHigh(NULL,0,i+8);

  double Low8 = iLow(NULL,0,i+8);

  double Hi9 = iHigh(NULL,0,i+9);

  double Low9 = iLow(NULL,0,i+9);

  double Hi10 = iHigh(NULL,0,i+10);

  double Low10 = iLow(NULL,0,i+10);

  double Hi11 = iHigh(NULL,0,i+11);

  double Low11 = iLow(NULL,0,i+11);

  double Hi12 = iHigh(NULL,0,i+12);

  double Low12 = iLow(NULL,0,i+12);

  double Hi13 = iHigh(NULL,0,i+13);

  double Low13 = iLow(NULL,0,i+13);

  double Hi14 = iHigh(NULL,0,i+14);

  double Low14 = iLow(NULL,0,i+14);

  double Hi15 = iHigh(NULL,0,i+15);

  double Low15 = iLow(NULL,0,i+15);

  double Hi16 = iHigh(NULL,0,i+16);

  double Low16 = iLow(NULL,0,i+16);

  double Hi17 = iHigh(NULL,0,i+17);

  double Low17 = iLow(NULL,0,i+17);

  double Hi18 = iHigh(NULL,0,i+18);

  double Low18 = iLow(NULL,0,i+18);

  double Hi19 = iHigh(NULL,0,i+19);

  double Low19 = iLow(NULL,0,i+19);

  double Hi20 = iHigh(NULL,0,i+20);

  double Low20 = iLow(NULL,0,i+20);

  double Hi21 = iHigh(NULL,0,i+21);

  double Low21 = iLow(NULL,0,i+21);

  double Hi22 = iHigh(NULL,0,i+22);

  double Low22 = iLow(NULL,0,i+22); 

  double Hi23 = iHigh(NULL,0,i+23);

  double Low23 = iLow(NULL,0,i+23);

  double Hi24 = iHigh(NULL,0,i+24);

  double Low24 = iLow(NULL,0,i+24);

  double Hi25 = iHigh(NULL,0,i+25);

  double Low25 = iLow(NULL,0,i+25);

  double Hi26 = iHigh(NULL,0,i+26);

  double Low26 = iLow(NULL,0,i+26);

  double Hi27 = iHigh(NULL,0,i+27);

  double Low27 = iLow(NULL,0,i+27);

  double Hi28 = iHigh(NULL,0,i+28);

  double Low28 = iLow(NULL,0,i+28);

  double Hi29 = iHigh(NULL,0,i+29);

  double Low29 = iLow(NULL,0,i+29);

  double Hi30 = iHigh(NULL,0,i+30);

  double Low30 = iLow(NULL,0,i+30);

  double Hi31 = iHigh(NULL,0,i+31);

  double Low31 = iLow(NULL,0,i+31);

  double Hi32 = iHigh(NULL,0,i+32);

  double Low32 = iLow(NULL,0,i+32);

  double Hi33 = iHigh(NULL,0,i+33);

  double Low33 = iLow(NULL,0,i+33);

  double Hi34 = iHigh(NULL,0,i+34);

  double Low34 = iLow(NULL,0,i+34);

  double Hi35 = iHigh(NULL,0,i+35);

  double Low35 = iLow(NULL,0,i+35);

  double Hi36 = iHigh(NULL,0,i+36);

  double Low36 = iLow(NULL,0,i+36);

  double Hi37 = iHigh(NULL,0,i+37);

  double Low37 = iLow(NULL,0,i+37);

  double Hi38 = iHigh(NULL,0,i+38);

  double Low38 = iLow(NULL,0,i+38);

  double Hi39 = iHigh(NULL,0,i+39);

  double Low39 = iLow(NULL,0,i+39);

  double Hi40 = iHigh(NULL,0,i+40);

  double Low40 = iLow(NULL,0,i+40);

  double Hi41 = iHigh(NULL,0,i+41);

  double Low41 = iLow(NULL,0,i+41);

  double Hi42 = iHigh(NULL,0,i+42);

  double Low42 = iLow(NULL,0,i+42);

  double Hi43 = iHigh(NULL,0,i+43);

  double Low43 = iLow(NULL,0,i+43);

  double Hi44 = iHigh(NULL,0,i+44);

  double Low44 = iLow(NULL,0,i+44); 

  double Hi45 = iHigh(NULL,0,i+45);

  double Low45 = iLow(NULL,0,i+45);

  double Hi46 = iHigh(NULL,0,i+46);

  double Low46 = iLow(NULL,0,i+46);

  double Hi47 = iHigh(NULL,0,i+47);

  double Low47 = iLow(NULL,0,i+47);

  double Hi48 = iHigh(NULL,0,i+48);

  double Low48 = iLow(NULL,0,i+48);

  double Hi49 = iHigh(NULL,0,i+49);

  double Low49 = iLow(NULL,0,i+49);

  double Hi50 = iHigh(NULL,0,i+50);

  double Low50 = iLow(NULL,0,i+50);

  double Hi51 = iHigh(NULL,0,i+51);

  double Low51 = iLow(NULL,0,i+51);

  double Hi52 = iHigh(NULL,0,i+52);

  double Low52 = iLow(NULL,0,i+52);

  double Hi53 = iHigh(NULL,0,i+53);

  double Low53 = iLow(NULL,0,i+53);

  double Hi54 = iHigh(NULL,0,i+54);

  double Low54 = iLow(NULL,0,i+54);

  double Hi55 = iHigh(NULL,0,i+55);

  double Low55 = iLow(NULL,0,i+55);

  double Hi56 = iHigh(NULL,0,i+56);

  double Low56 = iLow(NULL,0,i+56);

  double Hi57 = iHigh(NULL,0,i+57);

  double Low57 = iLow(NULL,0,i+57);

  double Hi58 = iHigh(NULL,0,i+58);

  double Low58 = iLow(NULL,0,i+58);

  double Hi59 = iHigh(NULL,0,i+59);

  double Low59 = iLow(NULL,0,i+59);

  double Hi60 = iHigh(NULL,0,i+60);

  double Low60 = iLow(NULL,0,i+60);

  double Hi61 = iHigh(NULL,0,i+61);

  double Low61 = iLow(NULL,0,i+61);

  double Hi62 = iHigh(NULL,0,i+62);

  double Low62 = iLow(NULL,0,i+62);

  double Hi63 = iHigh(NULL,0,i+63);

  double Low63 = iLow(NULL,0,i+63);

  double Hi64 = iHigh(NULL,0,i+64);

  double Low64 = iLow(NULL,0,i+64);

  double Hi65 = iHigh(NULL,0,i+65);

  double Low65 = iLow(NULL,0,i+65);

  

  Threshold =  ((Hi1-Low1)+(Hi2-Low2)+(Hi3-Low3)+(Hi4-Low4)+(Hi5-Low5)+

               (Hi6-Low6)+(Hi7-Low7)+(Hi8-Low8)+(Hi9-Low9)+(Hi10-Low10)+

               (Hi11-Low11)+(Hi12-Low12)+(Hi13-Low13)+(Hi14-Low14)+(Hi15-Low15)+

               (Hi16-Low16)+(Hi17-Low17)+(Hi18-Low18)+(Hi19-Low19)+(Hi20-Low20)+

               (Hi21-Low21)+(Hi22-Low22)+(Hi23-Low23)+(Hi24-Low24)+(Hi25-Low25)+

               (Hi26-Low26)+(Hi27-Low27)+(Hi28-Low28)+(Hi29-Low29)+(Hi30-Low30)+

               (Hi31-Low31)+(Hi32-Low32)+(Hi33-Low33)+(Hi34-Low34)+(Hi35-Low35)+

               (Hi36-Low36)+(Hi37-Low37)+(Hi38-Low38)+(Hi39-Low39)+(Hi40-Low40)+

               (Hi41-Low41)+(Hi42-Low42)+(Hi43-Low43)+(Hi44-Low44)+(Hi45-Low45)+

               (Hi46-Low46)+(Hi47-Low47)+(Hi48-Low48)+(Hi49-Low49)+(Hi50-Low50)+

               (Hi51-Low51)+(Hi52-Low52)+(Hi53-Low53)+(Hi54-Low54)+(Hi55-Low55)+

               (Hi56-Low56)+(Hi57-Low57)+(Hi58-Low58)+(Hi59-Low59)+(Hi60-Low60)+

               (Hi61-Low61)+(Hi62-Low62)+(Hi63-Low63)+(Hi64-Low64)+(Hi65-Low65))/65;

   

     if ((HighVal-LowVal)/Point >= Threshold/Point) { RANGEBuffer1[i] = (HighVal-LowVal)/Point; } 

     else { RANGEBuffer[i] = (HighVal-LowVal)/Point; } 


     // Draw Threshold line 

     int win_idx=WindowFind("RANGE"); 

 

/*

     ObjectDelete("Threshold"); 

     ObjectCreate("Threshold", OBJ_HLINE, win_idx, Time[0], Threshold); 

     ObjectSet("Threshold", OBJPROP_COLOR, ThresholdColor); 

     ObjectSet("Threshold", OBJPROP_STYLE, STYLE_SOLID); 

     ObjectSet("Threshold", OBJPROP_WIDTH, 1); 

     ObjectSet("Threshold", OBJPROP_BACK, true); 

    

     // Label for Threshold 

//     ObjectDelete("LabelThreshold"); 

//     ObjectCreate("LabelThreshold", OBJ_TEXT, win_idx, Time[0], Threshold); 

     ObjectSet("LabelThreshold", OBJPROP_COLOR, ThresholdColor); 

     ObjectSetText("LabelThreshold", "Threshold",8); 

    ObjectSet("LabelThreshold", OBJPROP_ANGLE, 0); 

*/      

     // Draw Current Bar line value 

     ObjectDelete("CurrentBarValue"); 

     ObjectCreate("CurrentBarValue", OBJ_HLINE, win_idx, Time[0], (iHigh(NULL,0,0)-iLow(NULL,0,0))/Point); 

     ObjectSet("CurrentBarValue", OBJPROP_COLOR, CurrentBarColor); 

     ObjectSet("CurrentBarValue", OBJPROP_STYLE, STYLE_SOLID); 

     ObjectSet("CurrentBarValue", OBJPROP_WIDTH, 1); 

     ObjectSet("CurrentBarValue", OBJPROP_BACK, true); 

      

     // Label per Current Bar Line 

//     ObjectDelete("LabelCurrentBarValue"); 

//     ObjectCreate("LabelCurrentBarValue", OBJ_TEXT, win_idx, Time[0], (iHigh(NULL,0,0)-iLow(NULL,0,0))/Point); 

     ObjectSet("LabelCurrentBarValue", OBJPROP_COLOR, CurrentBarColor); 

     ObjectSetText("LabelCurrentBarValue", "Current Bar value",8); 

     ObjectSet("LabelCurrentBarValue", OBJPROP_ANGLE, 0);      

   }    

    

//---- done 

   return(0); 

  }  

PJ
41
PJ  
mrtools:

Hello Josurf, made this one.

As a parting gift can you please put the symbol input so that a group of pairs can be compared by downloading those pairs in sub-windows.

Thank you. 

stormcombat
28
stormcombat  
Mladen Rakic:

Filippos

Use this one : ma_cross_histo_mtfalerts_nmc.

Is it possible to add a shift function to this particulaar indicator?

Thank you in advance.

To add comments, please log in or register