MT4 Indicator Mod, a little help please..

Moderator: admin

MT4 Indicator Mod, a little help please..

Postby lisa_baby_xx » Sun Jul 15, 2012 3:39 pm

Hello,

I am working on a very profitable MT4 trading system that has been many months in the planning. Anyway, I have only one thing stopping me from unleashing this on the markets..

Below is the indicator code for "MT4_Correlator_Separate_Window", what I need is for the values of the indicator on the right hand side to be removed and replaced by a zero line with plus and minus values (similar to MACD but without the histogram.)

If someone can fix this for me I will be more than willing to share the competed EA which this indicator is relying on.

Hope someone out there can help. :)
Happy pipping sweeties..
lisa_baby_xx

Code: Select all
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 DodgerBlue
//âõîäíûå ïàðàìåòðû
extern string simbol_name = "EURUSD";
extern int bars_for_autoscale = 200;
extern bool inverse = true;
extern bool MA = true;
extern int MAPeriod = 5;
extern bool MAOnly = true;

double simbolBuffer[];
double MABuffer[];

// èíèöèàëèçàöèÿ
int init()
  {
   SetIndexBuffer(0,simbolBuffer);       
   SetIndexStyle (0,DRAW_LINE);
   SetIndexBuffer(1,MABuffer);       
   SetLevelValue (0,1.2240);
 
   return (0);
  }
     
//îñíîâíîé öèêë                             

int start()
  {
double simbol_scale = 1;
double simbol_offset = 0;
 int i,k;
int cb=IndicatorCounted();
i = Bars-cb-1;
k = bars_for_autoscale;
if (bars_for_autoscale==0) k=Bars;
double max_scale=iClose(simbol_name,0,1);
double min_scale=iClose(simbol_name,0,1);
double max_scale2=Close[1];
double min_scale2=Close[1];
while(k>=0)
      {
     
      if (max_scale<iClose(simbol_name,0,k)) max_scale=iClose(simbol_name,0,k);
      if (min_scale>iClose(simbol_name,0,k)) min_scale=iClose(simbol_name,0,k);
      if (max_scale2<Close[k])max_scale2=Close[k];
      if (min_scale2>Close[k])min_scale2=Close[k];
   
   
      k--;
      }

simbol_scale = (max_scale2 - min_scale2)/(max_scale-min_scale);
      if(!inverse) {
 simbol_offset = max_scale2 - simbol_scale*max_scale;
 }
 else
 {
 simbol_offset = max_scale2 + simbol_scale*min_scale;
 }

while(i>=0)
      {
     
        if(!inverse)
        {
         if (!MAOnly) simbolBuffer[i]=simbol_scale*(iClose(simbol_name,0,i))+simbol_offset;
         if (MA)MABuffer[i]=(iMA(simbol_name,0,MAPeriod,0,0,PRICE_CLOSE,i))*simbol_scale+simbol_offset;
         }
        else
        {
        if (!MAOnly) simbolBuffer[i]=simbol_offset - simbol_scale*(iClose(simbol_name,0,i));
        if (MA)MABuffer[i]=simbol_offset - simbol_scale*(iMA(simbol_name,0,MAPeriod,0,0,PRICE_CLOSE,i));
        }
          i--;
      }

   
   return(0);
  }
lisa_baby_xx
 
Posts: 76
Joined: Sun Apr 17, 2011 5:37 am

Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 73 guests