stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Empty4 indicator different graphs Scaling?.
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3575
Page 1 of 1
Author:  Fxrichie [ Tue Apr 22, 2014 5:17 pm ]
Post subject:  Empty4 indicator different graphs Scaling?.

Hi, I am designing Indicator to plot graph of High of two Symbols( EURUSD, USDJPY).
Problem is that. :?:
- Indicator Plots High of both symbols as straight line.( It think it is due to scaling factor of both currencies are different.)

I like to see both symbols crossing inside indicator window.( in between -1 to +1)

Help me to plot both symbols with different Price scaling. If normalization is required then how.?

EURUSD Scaling range( 1.3499 to 1.3467)
USDJPY Scale Range (105.6445 to 100.9695)

Code is below.

Code: Select all

//***********************************************************************************************
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   return(0);
}


//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   return(0);
}


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{   
   int limit;
   int counted_bars=IndicatorCounted();
   //---- check for possible errors
   if(counted_bars<0) return(-1);
   //---- the last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   //---- main loop
   double aa[5000],bb[5000],cc[5000],dd[5000];
   for(int i=0; i<limit; i++)
   {


ExtMapBuffer1[i] = (iHigh("EURUSD", NULL,i));
ExtMapBuffer2[i] = (iHigh("USDJPY", NULL,i);
   }
      
   return(0);
}


//***********************************************************************************************
All times are UTC Page 1 of 1