Download MetaTrader 5
To add comments, please log in or register
Launch your trading signal. Make profit from paid subscription!
shi
4
shi 2014.07.04 03:45 

Hi,

 

I'm trying to combine a few indicators into one, and everything is going well, except for one small thing that I have never encountered before(the draw line function refuses to draw a solid line):

 

 compare the lines

 Here's the original code:

 

int init()

  {

   IndicatorBuffers(3);

   SetIndexBuffer(0, Uptrend);

   //ArraySetAsSeries(Uptrend, true); 

   SetIndexBuffer(1, Dntrend);

   //ArraySetAsSeries(Dntrend, true); 

   SetIndexBuffer(2, ExtMapBuffer);

   ArraySetAsSeries(ExtMapBuffer, true);

//----

   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);

   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);

//----

   IndicatorShortName("RA Trend");

   return(0);

  }

 

 Here is the edited code:

 

int init()
  {
  IndicatorBuffers(7);
  //signal1
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, CrossDown);
  
  
   //signal2
   
   SetIndexStyle(2,DRAW_ARROW);
   SetIndexArrow(2,234);
   SetIndexStyle(3,DRAW_ARROW);
   SetIndexArrow(3,233);
   SetIndexBuffer(2,val1);
   SetIndexBuffer(3,val2);
   
   //ratrend

   SetIndexStyle(4,DRAW_LINE,STYLE_SOLID,2);

   SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,2);

   SetIndexBuffer(4, Uptrend);



   SetIndexBuffer(5, Dntrend);
 

   SetIndexBuffer(6, ExtMapBuffer);

   ArraySetAsSeries(ExtMapBuffer, true);

//----


//----

   //IndicatorShortName("RA Trend");

//----
   return(0);
  }

 

Where did I go wrong?

 

Thanks in advance! 

/
To add comments, please log in or register