Sooo Close, but backwards

 

OK I have finally achieved what I have been working on for the last month except its backwards. I assume I need to reverse my index direction?


The bottom graph is what I'm trying to create. The top is where I have made it so far. As you can see the numbers seem to match pretty good however my lines are being created backwards. Any advice on how to fix this?


Backwards_Graph

 
SirFency:

OK I have finally achieved what I have been working on for the last month except its backwards. I assume I need to reverse my index direction?


The bottom graph is what I'm trying to create. The top is where I have made it so far. As you can see the numbers seem to match pretty good however my lines are being created backwards. Any advice on how to fix this?

Yes, fix your code.
 

I have been trying to figure out how to get my lines to draw in the opposite direction. They should originate at the lookback and spread apart as they reach the newest candle. I have tried to use ArraySetAsSeries but I am not understanding it. Can someone shed some light as to how I change the direction of the index or if that is even the correct solution.




//+------------------------------------------------------------------+
//|                               My_Currency_Strength_Indicator.mq4 |
//|                                               Erick_Fenstermaker |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Erick_Fenstermaker"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

//Opening a separate window and setting the parameters of the window extents
#property indicator_separate_window
#property indicator_maximum 5
#property indicator_minimum -5
#property indicator_level1 0

//Setting the number of memory buffers
#property indicator_buffers 8

//Setting up the memory allocation and default settings for the indicator lines
#property indicator_color1 clrPurple
#property indicator_color2 clrRed
#property indicator_color3 clrOrange
#property indicator_color4 clrWhite
#property indicator_color5 clrBlue
#property indicator_color6 clrGreen
#property indicator_color7 clrLightBlue
#property indicator_color8 clrYellow

//setting width of lines
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
#property indicator_width5 2
#property indicator_width6 2


//Declaring the array that will draw the line for the indicator
double EUR_Band[];
double GBP_Band[];
double AUD_Band[];
double NZD_Band[];
double USD_Band[];
double CAD_Band[];
double CHF_Band[];
double JPY_Band[];


//Declaration of the Arrays to store past values (Base Value)
double lookBackEURGBP[];
double lookBackEURAUD[];
double lookBackEURNZD[];
double lookBackEURUSD[];
double lookBackEURCAD[];
double lookBackEURCHF[];
double lookBackEURJPY[];

double lookBackGBPAUD[];
double lookBackGBPNZD[];
double lookBackGBPUSD[];
double lookBackGBPCAD[];
double lookBackGBPCHF[];
double lookBackGBPJPY[];

double lookBackAUDNZD[];
double lookBackAUDUSD[];
double lookBackAUDCAD[];
double lookBackAUDCHF[];
double lookBackAUDJPY[];

double lookBackNZDUSD[];
double lookBackNZDCAD[];
double lookBackNZDCHF[];
double lookBackNZDJPY[];

double lookBackUSDCAD[];
double lookBackUSDCHF[];
double lookBackUSDJPY[];

double lookBackCADCHF[];
double lookBackCADJPY[];

double lookBackCHFJPY[];

//Declaration of Arrays to store the current value of the EUR Symbols
double EURGBP[];
double EURAUD[];
double EURNZD[];
double EURUSD[];
double EURCAD[];
double EURCHF[];
double EURJPY[];

double GBPAUD[];
double GBPNZD[];
double GBPUSD[];
double GBPCAD[];
double GBPCHF[];
double GBPJPY[];

double AUDNZD[];
double AUDUSD[];
double AUDCAD[];
double AUDCHF[];
double AUDJPY[];

double NZDUSD[];
double NZDCAD[];
double NZDCHF[];
double NZDJPY[];

double USDCAD[];
double USDCHF[];
double USDJPY[];

double CADCHF[];
double CADJPY[];

double CHFJPY[];

//Declaration of Arrays to store percent change from Base value to the Current Value.
double perEURGBP[];
double perEURAUD[];
double perEURNZD[];
double perEURUSD[];
double perEURCAD[];
double perEURCHF[];
double perEURJPY[];

double perGBPAUD[];
double perGBPNZD[];
double perGBPUSD[];
double perGBPCAD[];
double perGBPCHF[];
double perGBPJPY[];

double perAUDNZD[];
double perAUDUSD[];
double perAUDCAD[];
double perAUDCHF[];
double perAUDJPY[];

double perNZDUSD[];
double perNZDCAD[];
double perNZDCHF[];
double perNZDJPY[];

double perUSDCAD[];
double perUSDCHF[];
double perUSDJPY[];

double perCADCHF[];
double perCADJPY[];

double perCHFJPY[];


//Declaration of Array to store the true strength of the EUR
double perEUR[];
double perGBP[];
double perAUD[];
double perNZD[];
double perUSD[];
double perCAD[];
double perCHF[];
double perJPY[];


//Sets how far you look into the past (15 min incremints 4 = 1hr)
int lookBack = 16 + 1;
int timeframe = PERIOD_M15;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int OnInit()
  {
  IndicatorBuffers(100);  
  


  
//--- indicator buffers for drawing the EUR oscillator line
   SetIndexBuffer(0,EUR_Band);
   SetIndexStyle(0,DRAW_LINE);
//I have tried to place the ArraySetAsSeries here but it does not seem to change direction
//ArraySetAsSeries(EUR_Band, true);
   SetIndexLabel(0,"EUR Band: ");
   
//--- indicator buffers for drawing the GBP oscillator line
   SetIndexBuffer(1,GBP_Band);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexLabel(1,"GBP Band: ");
   
//--- indicator buffers for drawing the AUD oscillator line
   SetIndexBuffer(2,AUD_Band);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexLabel(2,"AUD Band: ");
   
//--- indicator buffers for drawing the NZD oscillator line
   SetIndexBuffer(3,NZD_Band);
   SetIndexStyle(3,DRAW_LINE);
   SetIndexLabel(3,"NZD Band: ");
   
//--- indicator buffers for drawing the USD oscillator line
   SetIndexBuffer(4,USD_Band);
   SetIndexStyle(4,DRAW_LINE);
   SetIndexLabel(4,"USD Band: ");
   
//--- indicator buffers for drawing the CAD oscillator line
   SetIndexBuffer(5,CAD_Band);
   SetIndexStyle(5,DRAW_LINE);
   SetIndexLabel(5,"CAD Band: ");
   
//--- indicator buffers for drawing the CHF oscillator line
   SetIndexBuffer(6,CHF_Band);
   SetIndexStyle(6,DRAW_LINE);
   SetIndexLabel(6,"CHF Band: ");
  
//--- indicator buffers for drawing the JPY oscillator line
   SetIndexBuffer(7,JPY_Band);
   SetIndexStyle(7,DRAW_LINE);
   SetIndexLabel(7,"JPY Band: ");
  
//--- Indicator buffers for EUR Symbol close values from the past (Base Values)  
   SetIndexBuffer(8,lookBackEURGBP);
   SetIndexBuffer(9,lookBackEURAUD);
   SetIndexBuffer(10,lookBackEURNZD);
   SetIndexBuffer(11,lookBackEURUSD);
   SetIndexBuffer(12,lookBackEURCAD);
   SetIndexBuffer(13,lookBackEURCHF);
   SetIndexBuffer(14,lookBackEURJPY);
   
 //--- Indicator buffers for GBP Symbol close values from the past (Base Values)  
   SetIndexBuffer(15,lookBackGBPAUD);
   SetIndexBuffer(16,lookBackGBPNZD);
   SetIndexBuffer(17,lookBackGBPUSD);
   SetIndexBuffer(18,lookBackGBPCAD);
   SetIndexBuffer(19,lookBackGBPCHF);
   SetIndexBuffer(20,lookBackGBPJPY);
   
//--- Indicator buffers for AUD Symbol close values from the past (Base Values)  
   SetIndexBuffer(21,lookBackAUDNZD);
   SetIndexBuffer(22,lookBackAUDUSD);
   SetIndexBuffer(23,lookBackAUDCAD);
   SetIndexBuffer(24,lookBackAUDCHF);
   SetIndexBuffer(25,lookBackAUDJPY);
   
//--- Indicator buffers for NZD Symbol close values from the past (Base Values)  
   SetIndexBuffer(26,lookBackNZDUSD);
   SetIndexBuffer(27,lookBackNZDCAD);
   SetIndexBuffer(28,lookBackNZDCHF);
   SetIndexBuffer(29,lookBackNZDJPY);
   
//--- Indicator buffers for USD Symbol close values from the past (Base Values)  
   SetIndexBuffer(30,lookBackUSDCAD);
   SetIndexBuffer(31,lookBackUSDCHF);
   SetIndexBuffer(32,lookBackUSDJPY);
   
//--- Indicator buffers for CAD Symbol close values from the past (Base Values)  
   SetIndexBuffer(33,lookBackCADCHF);
   SetIndexBuffer(34,lookBackCADJPY);
   
//--- Indicator buffers for CHF Symbol close values from the past (Base Values)  
   SetIndexBuffer(35,lookBackCHFJPY);

   
//--- indicator buffers for the current EUR Symbol Ask Values
   SetIndexBuffer(36,EURGBP);
   SetIndexBuffer(37,EURAUD);
   SetIndexBuffer(38,EURNZD);
   SetIndexBuffer(39,EURUSD);
   SetIndexBuffer(40,EURCAD);
   SetIndexBuffer(41,EURCHF);
   SetIndexBuffer(42,EURJPY);
   
//--- indicator buffers for the current GBP Symbol Ask Values
   SetIndexBuffer(43,GBPAUD);
   SetIndexBuffer(44,GBPNZD);
   SetIndexBuffer(45,GBPUSD);
   SetIndexBuffer(46,GBPCAD);
   SetIndexBuffer(47,GBPCHF);
   SetIndexBuffer(48,GBPJPY);
   
//--- indicator buffers for the current AUD Symbol Ask Values
   SetIndexBuffer(49,AUDNZD);
   SetIndexBuffer(50,AUDUSD);
   SetIndexBuffer(51,AUDCAD);
   SetIndexBuffer(52,AUDCHF);
   SetIndexBuffer(53,AUDJPY);
   
//--- indicator buffers for the current NZD Symbol Ask Values
   SetIndexBuffer(54,NZDUSD);
   SetIndexBuffer(55,NZDCAD);
   SetIndexBuffer(56,NZDCHF);
   SetIndexBuffer(57,NZDJPY);
  
//--- indicator buffers for the current USD Symbol Ask Values
   SetIndexBuffer(58,USDCAD);
   SetIndexBuffer(59,USDCHF);
   SetIndexBuffer(60,USDJPY);
   
//--- indicator buffers for the current CAD Symbol Ask Values
   SetIndexBuffer(61,CADCHF);
   SetIndexBuffer(62,CADJPY);
   
//--- indicator buffers for the current CHF Symbol Ask Values
   SetIndexBuffer(63,CHFJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the EUR values  
   SetIndexBuffer(64,perEURGBP);
   SetIndexBuffer(65,perEURAUD);
   SetIndexBuffer(66,perEURNZD);
   SetIndexBuffer(67,perEURUSD);
   SetIndexBuffer(68,perEURCAD);
   SetIndexBuffer(69,perEURCHF);
   SetIndexBuffer(70,perEURJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the GBP values  
   SetIndexBuffer(71,perGBPAUD);
   SetIndexBuffer(72,perGBPNZD);
   SetIndexBuffer(73,perGBPUSD);
   SetIndexBuffer(74,perGBPCAD);
   SetIndexBuffer(75,perGBPCHF);
   SetIndexBuffer(76,perGBPJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the AUD values  
   SetIndexBuffer(77,perAUDNZD);
   SetIndexBuffer(78,perAUDUSD);
   SetIndexBuffer(79,perAUDCAD);
   SetIndexBuffer(80,perAUDCHF);
   SetIndexBuffer(81,perAUDJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the NZD values  
   SetIndexBuffer(82,perNZDUSD);
   SetIndexBuffer(83,perNZDCAD);
   SetIndexBuffer(84,perNZDCHF);
   SetIndexBuffer(85,perNZDJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the USD values  
   SetIndexBuffer(86,perUSDCAD);
   SetIndexBuffer(87,perUSDCHF);
   SetIndexBuffer(88,perUSDJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the CAD values  
   SetIndexBuffer(89,perCADCHF);
   SetIndexBuffer(90,perCADJPY);
   
//--- indicator buffers for the percent change from the past open till the current ask of the CHF values  
   SetIndexBuffer(91,perCHFJPY);
   
//--- indicator buffers for the true strength of the symbol
   SetIndexBuffer(92,perEUR);
   SetIndexBuffer(93,perGBP);
   SetIndexBuffer(94,perAUD);
   SetIndexBuffer(95,perNZD);
   SetIndexBuffer(96,perUSD);
   SetIndexBuffer(97,perCAD);
   SetIndexBuffer(98,perCHF);
   SetIndexBuffer(99,perJPY);

   

   
//---
   return(INIT_SUCCEEDED);
  }
  
  
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[]){

//This is telling me that my array is not set as time series.                
if(ArrayIsSeries(EUR_Band)) 
      Print("EUR_Band[] is timeseries"); 
   else 
      Print("EUR_Band[] is not timeseries!!!"); 


//looking at older bars
int counted_bars,limit;
counted_bars = IndicatorCounted();
if(!counted_bars)limit = Bars;// - 2;
else limit = Bars - counted_bars;// - 1;
if(rates_total!=prev_calculated)
   for(int i=0; i <= lookBack; i++)
     {
     
//Gathers the EUR Symbol close values from the past (Base Values)   
lookBackEURGBP[i] = iClose("EURGBP",timeframe,i);
lookBackEURAUD[i] = iClose("EURAUD",timeframe,i);
lookBackEURNZD[i] = iClose("EURNZD",timeframe,i);
lookBackEURUSD[i] = iClose("EURUSD",timeframe,i);
lookBackEURCAD[i] = iClose("EURCAD",timeframe,i);
lookBackEURCHF[i] = iClose("EURCHF",timeframe,i);
lookBackEURJPY[i] = iClose("EURJPY",timeframe,i);

//Gathers the GBP Symbol close values from the past (Base Values)   
lookBackGBPAUD[i] = iClose("GBPAUD",timeframe,i);
lookBackGBPNZD[i] = iClose("GBPNZD",timeframe,i);
lookBackGBPUSD[i] = iClose("GBPUSD",timeframe,i);
lookBackGBPCAD[i] = iClose("GBPCAD",timeframe,i);
lookBackGBPCHF[i] = iClose("GBPCHF",timeframe,i);
lookBackGBPJPY[i] = iClose("GBPJPY",timeframe,i);

//Gathers the AUD Symbol close values from the past (Base Values)   
lookBackAUDNZD[i] = iClose("AUDNZD",timeframe,i);
lookBackAUDUSD[i] = iClose("AUDUSD",timeframe,i);
lookBackAUDCAD[i] = iClose("AUDCAD",timeframe,i);
lookBackAUDCHF[i] = iClose("AUDCHF",timeframe,i);
lookBackAUDJPY[i] = iClose("AUDJPY",timeframe,i);

//Gathers the NZD Symbol close values from the past (Base Values)   
lookBackNZDUSD[i] = iClose("NZDUSD",timeframe,i);
lookBackNZDCAD[i] = iClose("NZDCAD",timeframe,i);
lookBackNZDCHF[i] = iClose("NZDCHF",timeframe,i);
lookBackNZDJPY[i] = iClose("NZDJPY",timeframe,i);

//Gathers the USD Symbol close values from the past (Base Values)   
lookBackUSDCAD[i] = iClose("USDCAD",timeframe,i);
lookBackUSDCHF[i] = iClose("USDCHF",timeframe,i);
lookBackUSDJPY[i] = iClose("USDJPY",timeframe,i);

//Gathers the CAD Symbol close values from the past (Base Values)   
lookBackCADCHF[i] = iClose("CADCHF",timeframe,i);
lookBackCADJPY[i] = iClose("CADJPY",timeframe,i);

//Gathers the CHF Symbol close values from the past (Base Values)   
lookBackCHFJPY[i] = iClose("CHFJPY",timeframe,i);


//Gathers the current EUR Symbol Ask Values
EURGBP[i] = SymbolInfoDouble("EURGBP", SYMBOL_ASK);
EURAUD[i] = SymbolInfoDouble("EURAUD", SYMBOL_ASK);
EURNZD[i] = SymbolInfoDouble("EURNZD", SYMBOL_ASK);
EURUSD[i] = SymbolInfoDouble("EURUSD", SYMBOL_ASK);
EURCAD[i] = SymbolInfoDouble("EURCAD", SYMBOL_ASK);
EURCHF[i] = SymbolInfoDouble("EURCHF", SYMBOL_ASK);
EURJPY[i] = SymbolInfoDouble("EURJPY", SYMBOL_ASK);

//Gathers the current GBP Symbol Ask Values
GBPAUD[i] = SymbolInfoDouble("GBPAUD", SYMBOL_ASK);
GBPNZD[i] = SymbolInfoDouble("GBPNZD", SYMBOL_ASK);
GBPUSD[i] = SymbolInfoDouble("GBPUSD", SYMBOL_ASK);
GBPCAD[i] = SymbolInfoDouble("GBPCAD", SYMBOL_ASK);
GBPCHF[i] = SymbolInfoDouble("GBPCHF", SYMBOL_ASK);
GBPJPY[i] = SymbolInfoDouble("GBPJPY", SYMBOL_ASK);

//Gathers the current AUD Symbol Ask Values
AUDNZD[i] = SymbolInfoDouble("AUDNZD", SYMBOL_ASK);
AUDUSD[i] = SymbolInfoDouble("AUDUSD", SYMBOL_ASK);
AUDCAD[i] = SymbolInfoDouble("AUDCAD", SYMBOL_ASK);
AUDCHF[i] = SymbolInfoDouble("AUDCHF", SYMBOL_ASK);
AUDJPY[i] = SymbolInfoDouble("AUDJPY", SYMBOL_ASK);

//Gathers the current NZD Symbol Ask Values
NZDUSD[i] = SymbolInfoDouble("NZDUSD", SYMBOL_ASK);
NZDCAD[i] = SymbolInfoDouble("NZDCAD", SYMBOL_ASK);
NZDCHF[i] = SymbolInfoDouble("NZDCHF", SYMBOL_ASK);
NZDJPY[i] = SymbolInfoDouble("NZDJPY", SYMBOL_ASK);

//Gathers the current USD Symbol Ask Values
USDCAD[i] = SymbolInfoDouble("USDCAD", SYMBOL_ASK);
USDCHF[i] = SymbolInfoDouble("USDCHF", SYMBOL_ASK);
USDJPY[i] = SymbolInfoDouble("USDJPY", SYMBOL_ASK);

//Gathers the current CAD Symbol Ask Values
CADCHF[i] = SymbolInfoDouble("CADCHF", SYMBOL_ASK);
CADJPY[i] = SymbolInfoDouble("CADJPY", SYMBOL_ASK);

//Gathers the current CHF Symbol Ask Values
CHFJPY[i] = SymbolInfoDouble("CHFJPY", SYMBOL_ASK);


//Calcualtes the percent change from the past open till the current ask of the EUR values
perEURGBP[i] = (EURGBP[i] - lookBackEURGBP[i] + 0.0000000001)/(lookBackEURGBP[i] + 0.0000000001)*100;
perEURAUD[i] = (EURAUD[i] - lookBackEURAUD[i] + 0.0000000001)/(lookBackEURAUD[i] + 0.0000000001)*100;
perEURNZD[i] = (EURNZD[i] - lookBackEURNZD[i] + 0.0000000001)/(lookBackEURNZD[i] + 0.0000000001)*100;
perEURUSD[i] = (EURUSD[i] - lookBackEURUSD[i] + 0.0000000001)/(lookBackEURUSD[i] + 0.0000000001)*100;
perEURCAD[i] = (EURCAD[i] - lookBackEURCAD[i] + 0.0000000001)/(lookBackEURCAD[i] + 0.0000000001)*100;
perEURCHF[i] = (EURCHF[i] - lookBackEURCHF[i] + 0.0000000001)/(lookBackEURCHF[i] + 0.0000000001)*100;
perEURJPY[i] = (EURJPY[i] - lookBackEURJPY[i] + 0.0000000001)/(lookBackEURJPY[i] + 0.0000000001)*100;

//Calcualtes the percent change from the past open till the current ask of the GBP values
perGBPAUD[i] = (GBPAUD[i] - lookBackGBPAUD[i] + 0.0000000001)/(lookBackGBPAUD[i] + 0.0000000001)*100;
perGBPNZD[i] = (GBPNZD[i] - lookBackGBPNZD[i] + 0.0000000001)/(lookBackGBPNZD[i] + 0.0000000001)*100;
perGBPUSD[i] = (GBPUSD[i] - lookBackGBPUSD[i] + 0.0000000001)/(lookBackGBPUSD[i] + 0.0000000001)*100;
perGBPCAD[i] = (GBPCAD[i] - lookBackGBPCAD[i] + 0.0000000001)/(lookBackGBPCAD[i] + 0.0000000001)*100;
perGBPCHF[i] = (GBPCHF[i] - lookBackGBPCHF[i] + 0.0000000001)/(lookBackGBPCHF[i] + 0.0000000001)*100;
perGBPJPY[i] = (GBPJPY[i] - lookBackGBPJPY[i] + 0.0000000001)/(lookBackGBPJPY[i] + 0.0000000001)*100;

//Calcualtes the percent change from the past open till the current ask of the AUD values
perAUDNZD[i] = (AUDNZD[i] - lookBackAUDNZD[i] + 0.0000000001)/(lookBackAUDNZD[i] + 0.0000000001)*100;
perAUDUSD[i] = (AUDUSD[i] - lookBackAUDUSD[i] + 0.0000000001)/(lookBackAUDUSD[i] + 0.0000000001)*100;
perAUDCAD[i] = (AUDCAD[i] - lookBackAUDCAD[i] + 0.0000000001)/(lookBackAUDCAD[i] + 0.0000000001)*100;
perAUDCHF[i] = (AUDCHF[i] - lookBackAUDCHF[i] + 0.0000000001)/(lookBackAUDCHF[i] + 0.0000000001)*100;
perAUDJPY[i] = (AUDJPY[i] - lookBackAUDJPY[i] + 0.0000000001)/(lookBackAUDJPY[i] + 0.0000000001)*100;

//Calcualtes the percent change from the past open till the current ask of the NZD values
perNZDUSD[i] = (NZDUSD[i] - lookBackNZDUSD[i] + 0.0000000001)/(lookBackNZDUSD[i] + 0.0000000001)*100;
perNZDCAD[i] = (NZDCAD[i] - lookBackNZDCAD[i] + 0.0000000001)/(lookBackNZDCAD[i] + 0.0000000001)*100;
perNZDCHF[i] = (NZDCHF[i] - lookBackNZDCHF[i] + 0.0000000001)/(lookBackNZDCHF[i] + 0.0000000001)*100;
perNZDJPY[i] = (NZDJPY[i] - lookBackNZDJPY[i] + 0.0000000001)/(lookBackNZDJPY[i] + 0.0000000001)*100;

//Calcualtes the percent change from the past open till the current ask of the USD values
perUSDCAD[i] = (USDCAD[i] - lookBackUSDCAD[i] + 0.0000000001)/(lookBackUSDCAD[i] + 0.0000000001)*100;
perUSDCHF[i] = (USDCHF[i] - lookBackUSDCHF[i] + 0.0000000001)/(lookBackUSDCHF[i] + 0.0000000001)*100;
perUSDJPY[i] = (USDJPY[i] - lookBackUSDJPY[i] + 0.0000000001)/(lookBackUSDJPY[i] + 0.0000000001)*100;

//Calcualtes the percent change from the past open till the current ask of the CAD values
perCADCHF[i] = (CADCHF[i] - lookBackCADCHF[i] + 0.0000000001)/(lookBackCADCHF[i] + 0.0000000001)*100;
perCADJPY[i] = (CADJPY[i] - lookBackCADJPY[i] + 0.0000000001)/(lookBackCADJPY[i] + 0.0000000001)*100;

//Calcualtes the percent change from the past open till the current ask of the CHF values
perCHFJPY[i] = (CHFJPY[i] - lookBackCHFJPY[i] + 0.0000000001)/(lookBackCHFJPY[i] + 0.0000000001)*100;

     
//Calculates true strength of the EUR
perEUR[i] = (perEURGBP[i] + perEURAUD[i] + perEURNZD[i] + perEURUSD[i] + perEURCAD[i] + perEURCHF[i] + perEURJPY[i]);
perGBP[i] = ((-perEURGBP[i]) + perGBPAUD[i] + perGBPNZD[i] + perGBPUSD[i] + perGBPCAD[i] + perGBPCHF[i] + perGBPJPY[i]);     
perAUD[i] = (((-perEURAUD[i]) + (-perGBPAUD[i])) + perAUDNZD[i] + perAUDUSD[i] + perAUDCAD[i] + perAUDCHF[i] + perAUDJPY[i]);
perNZD[i] = (((-perEURNZD[i]) + (-perGBPNZD[i]) + (-perAUDNZD[i])) + perNZDUSD[i] + perNZDCAD[i] + perNZDCHF[i] + perNZDJPY[i]);
perUSD[i] = (((-perEURUSD[i]) + (-perGBPUSD[i]) + (-perAUDUSD[i]) + (-perNZDUSD[i])) + perUSDCAD[i] + perUSDCHF[i] + perUSDJPY[i]);
perCAD[i] = (((-perEURCAD[i]) + (-perGBPCAD[i]) + (-perAUDCAD[i]) + (-perNZDCAD[i]) + (-perUSDCAD[i])) + perCADCHF[i] + perCADJPY[i]);
perCHF[i] = (((-perEURCHF[i]) + (-perGBPCHF[i]) + (-perAUDCHF[i]) + (-perNZDCHF[i]) + (-perUSDCHF[i]) + (-perCADCHF[i])) + perCHFJPY[i]);
perJPY[i] = ((-perEURJPY[i]) + (-perGBPJPY[i]) + (-perAUDJPY[i]) + (-perNZDJPY[i]) + (-perUSDJPY[i]) + (-perCADJPY[i]) + (-perCHFJPY[i]));


      EUR_Band[i] = perEUR[i];
      GBP_Band[i] = perGBP[i];
      AUD_Band[i] = perAUD[i];
      NZD_Band[i] = perNZD[i];
      USD_Band[i] = perUSD[i];
      CAD_Band[i] = perCAD[i];
      CHF_Band[i] = perCHF[i];
      JPY_Band[i] = perJPY[i];
      
      Print("EUR ",EUR_Band[0]);
      Print("GBP ",GBP_Band[0]);
      Print("AUD ",AUD_Band[0]);
      Print("NZD ",NZD_Band[0]);
      Print("USD ",USD_Band[0]);
      Print("CAD ",CAD_Band[0]);
      Print("CHF ",CHF_Band[0]);
      Print("JPY ",JPY_Band[0]);
      


     }
   return(rates_total);
  }