Jump to content

MultiRVI


chetachukwu

Recommended Posts

Re: (Req) MultiRVI

 

please enjoy....

 

#property copyright "© 2007 BJF Trading Group"
#property link      "http://iticsoftware.com"

#define major   1
#define minor   0

#property indicator_separate_window
#property indicator_buffers 8
#property indicator_color1  Gold
#property indicator_color2  Gold
#property indicator_color3  DodgerBlue
#property indicator_color4  DodgerBlue
#property indicator_color5  DeepPink
#property indicator_color6  DeepPink
#property indicator_color7  SeaGreen
#property indicator_color8  SeaGreen

extern int period = 5; 

extern int TimeFrame1 = PERIOD_H1;
extern int TimeFrame2 = PERIOD_H4;
extern int TimeFrame3 = PERIOD_D1;
extern int TimeFrame4 = PERIOD_W1; 


double rvi1[];
double rvi2[];
double rvi3[];
double rvi4[];
double rvi5[];
double rvi6[];
double rvi7[];
double rvi8[];


void init()
{       
  SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1);
  SetIndexStyle(1, DRAW_LINE, STYLE_DOT, 1);
  SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 1);
  SetIndexStyle(3, DRAW_LINE, STYLE_DOT, 1);
  SetIndexStyle(4, DRAW_LINE, STYLE_SOLID, 1);
  SetIndexStyle(5, DRAW_LINE, STYLE_DOT, 1);
  SetIndexStyle(6, DRAW_LINE, STYLE_SOLID, 1);
  SetIndexStyle(7, DRAW_LINE, STYLE_DOT, 1);

  SetIndexBuffer(0, rvi1);
  SetIndexBuffer(1, rvi2);
  SetIndexBuffer(2, rvi3);
  SetIndexBuffer(3, rvi4);
  SetIndexBuffer(4, rvi5);
  SetIndexBuffer(5, rvi6);
  SetIndexBuffer(6, rvi7);
  SetIndexBuffer(7, rvi8);
}

void deinit() {
}  

void start() 
{
 int counted = IndicatorCounted();
 if (counted < 0) return (-1);
 
 if (counted > 0) counted--;
 int limit = Bars-counted;
 
 for (int i=0; i < limit; i++) 
 {
   int bar = iBarShift(NULL, TimeFrame1, Time[i]);
   rvi1[i] = iRVI(NULL, TimeFrame1, period, MODE_MAIN, bar);
   rvi2[i] = iRVI(NULL, TimeFrame1, period, MODE_SIGNAL, bar);

   bar = iBarShift(NULL, TimeFrame2, Time[i]);
   rvi3[i] = iRVI(NULL, TimeFrame2, period, MODE_MAIN, bar);
   rvi4[i] = iRVI(NULL, TimeFrame2, period, MODE_SIGNAL, bar);

   bar = iBarShift(NULL, TimeFrame3, Time[i]);
   rvi5[i] = iRVI(NULL, TimeFrame3, period, MODE_MAIN, bar);
   rvi6[i] = iRVI(NULL, TimeFrame3, period, MODE_SIGNAL, bar);

   bar = iBarShift(NULL, TimeFrame4, Time[i]);
   rvi7[i] = iRVI(NULL, TimeFrame4, period, MODE_MAIN, bar);
   rvi8[i] = iRVI(NULL, TimeFrame4, period, MODE_SIGNAL, bar);

 }
}

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...