Download MetaTrader 5

iCustom on semafor

To add comments, please log in or register
rooky06
45
rooky06  
Hello

I try to catch the '1,2,3' on semafor but  all are not catched.

i use it

int pos = Bars - countedBars;
  
      if(iBuffer1[pos]==EMPTY_VALUE)
        {
         iBuffer1[pos]=iCustom(Symbol(),0,"3_Level_ZZ_Semafor",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3,Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,0,0);
        }

My goal is to take the 3 when it appears and whenever it appears. I want to have a suite of 3 and not that the last.

Where is my error  ?


Thank you for your advice

honest_knave
Moderator
2296
honest_knave  
rooky06:
Hello

I try to catch the '1,2,3' on semafor but  all are not catched.

i use it

int pos = Bars - countedBars;
  
      if(iBuffer1[pos]==EMPTY_VALUE)
        {
         iBuffer1[pos]=iCustom(Symbol(),0,"3_Level_ZZ_Semafor",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3,Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,0,0);
        }

I don't use that indicator, but are you sure it paints anything on the current bar? i.e. shift 0
Mladen Rakic
63838
Mladen Rakic  
honest_knave:
I don't use that indicator, but are you sure it paints anything on the current bar? i.e. shift 0
It does not values for current bar the way he expects it (it is using the zigzag and works exactly as zigzag does)
rooky06
45
rooky06  
Mladen Rakic:
It does not values for current bar the way he expects it (it is using the zigzag and works exactly as zigzag does)
Ok but with the zigzak we can catch the las bar value. There is a value or it's empty only befor it's change.

With the semafor it's strange.

Semafor repaints : at the end, the 3 is paint on chart, 3 times the same value in data window but not when we use iCustom on the last bar

I try like this


#property indicator_separate_window

#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Pink
#property indicator_color3 Lime

#property indicator_minimum 0
#property indicator_maximum 7

extern double Period1=5;
extern double Period2=13;
extern double Period3=34;
extern string   Dev_Step_1="1,3";
extern string   Dev_Step_2="8,5";
extern string   Dev_Step_3="21,12";
extern int Symbol_1_Kod=140;
extern int Symbol_2_Kod=141;
extern int Symbol_3_Kod=142;
double iBuffer1[];
double iBuffer2[];
double iBuffer3[];
int NbBars;
int init() {

   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,iBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,iBuffer2);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,iBuffer3);


   string name = "Geronimo Signal";

   IndicatorShortName(name);

   return(1);
}

int deinit() {
   return(0);
}

int start() {
   int countedBars=IndicatorCounted();

   if (countedBars<0) {
      return(-1);
   }

   if (countedBars>0) {
      countedBars--;
   }

   int pos = Bars - countedBars;

   Comment("");

  
      if(iBuffer1[pos]==EMPTY_VALUE)
        {
        iBuffer1[pos]=iCustom(Symbol(),0,"3_Level_ZZ_Semafor",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3,Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,1,1)*5;
        iBuffer2[pos]=iCustom(Symbol(),0,"3_Level_ZZ_Semafor",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3,Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,2,1)*3;
        iBuffer3[pos]=iCustom(Symbol(),0,"3_Level_ZZ_Semafor",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3,Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,3,1);
        }
      
  

   return(0);
}
So is there a solution to catch the 3 on the last bar ? Wher is my code wrong ?

Thank you for your hel, i m newbie... in english to
To add comments, please log in or register