ChelseaB's suggestion of using AddDataSeries over AddRenko() seems to produce the values I am trying to obtain from adding multiple time frames to the same strategy. AddRenko was returning incorrect Closes[

**] values, which AddDataSeries fixed. Here is my code of the State.Configure section:**

*X*AddDataSeries(null, new BarsPeriod { BarsPeriodType = (BarsPeriodType)1995, Value = 16, Value2 = 3, BaseBarsPeriodValue = 50, MarketDataType = MarketDataType.Last});

AddDataSeries(null, new BarsPeriod { BarsPeriodType = (BarsPeriodType)1995, Value = 32, Value2 = 3, BaseBarsPeriodValue = 50, MarketDataType = MarketDataType.Last});

During my

**event, at the start of the event, I have a region of code that loads data into my arrays. This region has four large**

*OnBarUpdate***blocks that test against**

*IF**to insure the correct arrays are populated using the correct close at the appropriate time. The test in the image is based when*

**BarsInProgress****; the code for which is below:**

*BarsInProgress = 1*if (BarsInProgress == 1)

{

if (CurrentBars[1] < 1) return;

tmpCurBar8 = CurrentBar;

//prepair arrays (jelURBars 8) to hold a new value - increase array size by one

jelIncreaseArrayDouble(ref arrayHammer8, 1);

jelIncreaseArrayDouble(ref arrayTrend8, 1);

jelIncreaseArrayDouble(ref arrayDirTH8, 1);

jelIncreaseArrayDouble(ref arraySCTrigger8, 1);

jelIncreaseArrayDouble(ref arraySCHedge8, 1);

jelIncreaseArrayDouble(ref arraySCSignal8, 1);

jelIncreaseArrayDouble(ref arrayDirSC8, 1);

jelIncreaseArrayDouble(ref arrayZZLow8, 1);

jelIncreaseArrayDouble(ref arrayZZHigh8, 1);

jelIncreaseArrayDouble(ref arrayLRI8, 1);

jelIncreaseArrayDouble(ref arrayTHPower8, 1);

jelIncreaseArrayDouble(ref arraySCPower8, 1);

//obtain last highest and lowest piviots

double tmpPHigh = 0;

double tmpPLow = 0;

jelZigZag(ref tmpPHigh, ref tmpPLow, Closes[1]);

arrayZZLow8[arrayZZLow8.Length - 1] = tmpPLow;

arrayZZHigh8[arrayZZHigh8.Length - 1] = tmpPHigh;

//obtain Trend and Hammer

double tmpTrend = 0;

double tmpHammer = 0;

double tmpTHDir = 0;

jelTHExt(ref tmpTrend, ref tmpHammer, Closes[1], CurrentBars[1]);

arrayHammer8[arrayHammer8.Length - 1] = tmpHammer;

arrayTrend8[arrayTrend8.Length - 1] = tmpTrend;

tmpTHDir = jelTHDirection(arrayTrend8);

arrayTHPower8[arrayTHPower8.Length - 1] = tmpTHDir;

if (tmpTHDir < 0) arrayDirTH8[arrayDirTH8.Length - 1] = -1;

if (tmpTHDir > 0) arrayDirTH8[arrayDirTH8.Length - 1] = 1;

//obtain SC

double tmpSCHedge = 0;

double tmpSCTrigger = 0;

double tmpSCSignal = 0;

double tmpSCDir = 0;

jelSCExt(ref tmpSCHedge, ref tmpSCTrigger, ref tmpSCSignal, Closes[1], CurrentBars[1]);

Print(String.Format("T8: {0} | tmpSCHedge: {1} | tmpSCTrigger {2}",

Time[0], tmpSCHedge, tmpSCTrigger));

arraySCHedge8[arraySCHedge8.Length - 1] = tmpSCHedge;

arraySCTrigger8[arraySCTrigger8.Length - 1] = tmpSCTrigger;

arraySCSignal8[arraySCSignal8.Length - 1] = tmpSCSignal;

tmpSCDir = jelSCDirection(tmpSCHedge, tmpSCTrigger);

arraySCPower8[arraySCPower8.Length - 1] = tmpSCDir;

if (tmpSCDir < 0) arrayDirSC8[arrayDirSC8.Length - 1] = -1;

if (tmpSCDir > 0) arrayDirSC8[arrayDirSC8.Length - 1] = -1;

//obtain linear regression intercept.

double tmpLRI = 0;

tmpLRI = LinRegIntercept(Closes[1], lriPeriod)[0];

arrayLRI8[arrayLRI8.Length - 1] = tmpLRI;

}

After the data load region is complete, I have created a test block of code to perform unit testing with multiple print statements as follows:

double curPower = jelGetPower();

//if (BarsInProgress != 0) return;

if (BarsInProgress != 1) return;

//if (BarsInProgress != 2) return;

//if (BarsInProgress != 3) return;

Print("==========================================S TART===================================");

Print(String.Format("04: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer4[arrayHammer4.Length - 1], arrayTrend4[arrayTrend4.Length - 1], arraySCHedge4[arraySCHedge4.Length - 1], arraySCTrigger4[arraySCTrigger4.Length -1], curPower, arrayDirTH4[arrayDirTH4.Length - 1], arrayDirSC4[arrayDirSC4.Length - 1], arrayZZLow4[arrayZZLow4.Length -1], arrayZZHigh4[arrayZZHigh4.Length - 1], arrayLRI4[arrayLRI4.Length - 1]));

Print(String.Format("08: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer8[arrayHammer8.Length - 1], arrayTrend8[arrayTrend8.Length - 1], arraySCHedge8[arraySCHedge8.Length - 1], arraySCTrigger8[arraySCTrigger8.Length -1], curPower, arrayDirTH8[arrayDirTH8.Length - 1], arrayDirSC8[arrayDirSC8.Length - 1] , arrayZZLow8[arrayZZLow8.Length -1], arrayZZHigh8[arrayZZHigh8.Length - 1], arrayLRI4[arrayLRI8.Length - 1]));

Print(String.Format("16: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer16[arrayHammer16.Length - 1], arrayTrend16[arrayTrend16.Length - 1], arraySCHedge16[arraySCHedge16.Length - 1], arraySCTrigger16[arraySCTrigger16.Length -1], curPower, arrayDirTH16[arrayDirTH16.Length - 1], arrayDirSC16[arrayDirSC16.Length - 1] , arrayZZLow16[arrayZZLow16.Length -1], arrayZZHigh16[arrayZZHigh16.Length - 1], arrayLRI16[arrayLRI16.Length - 1]));

Print(String.Format("32: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer32[arrayHammer32.Length - 1], arrayTrend32[arrayTrend32.Length - 1], arraySCHedge32[arraySCHedge32.Length - 1], arraySCTrigger32[arraySCTrigger32.Length -1], curPower, arrayDirTH32[arrayDirTH32.Length - 1], arrayDirSC32[arrayDirSC32.Length - 1] , arrayZZLow32[arrayZZLow32.Length -1], arrayZZHigh32[arrayZZHigh32.Length - 1], arrayLRI32[arrayLRI32.Length - 1]));

Print(" ");

Print("-----------------------------------PREVIOUS---------------------------------------");

if (CurrentBars[3] > 2)

{

Print(String.Format("04: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer4[arrayHammer4.Length - 2], arrayTrend4[arrayTrend4.Length - 2], arraySCHedge4[arraySCHedge4.Length - 2], arraySCTrigger4[arraySCTrigger4.Length - 2], curPower, arrayDirTH4[arrayDirTH4.Length - 2], arrayDirSC4[arrayDirSC4.Length - 2], arrayZZLow4[arrayZZLow4.Length - 2], arrayZZHigh4[arrayZZHigh4.Length - 2], arrayLRI4[arrayLRI4.Length - 2]));

Print(String.Format("08: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer8[arrayHammer8.Length - 2], arrayTrend8[arrayTrend8.Length - 2], arraySCHedge8[arraySCHedge8.Length - 2], arraySCTrigger8[arraySCTrigger8.Length - 2], curPower, arrayDirTH8[arrayDirTH8.Length - 2], arrayDirSC8[arrayDirSC8.Length - 2] , arrayZZLow8[arrayZZLow8.Length - 2], arrayZZHigh8[arrayZZHigh8.Length - 2], arrayLRI4[arrayLRI8.Length - 2]));

Print(String.Format("16: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer16[arrayHammer16.Length - 1], arrayTrend16[arrayTrend16.Length - 2], arraySCHedge16[arraySCHedge16.Length - 2], arraySCTrigger16[arraySCTrigger16.Length - 2], curPower, arrayDirTH16[arrayDirTH16.Length - 2], arrayDirSC16[arrayDirSC16.Length - 2] , arrayZZLow16[arrayZZLow16.Length - 2], arrayZZHigh16[arrayZZHigh16.Length - 2], arrayLRI16[arrayLRI16.Length - 2]));

Print(String.Format("32: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",

Time[0], BarsInProgress, CurrentBar, arrayHammer32[arrayHammer32.Length - 2], arrayTrend32[arrayTrend32.Length - 2], arraySCHedge32[arraySCHedge32.Length - 2], arraySCTrigger32[arraySCTrigger32.Length - 2], curPower, arrayDirTH32[arrayDirTH32.Length - 2], arrayDirSC32[arrayDirSC32.Length - 2] , arrayZZLow32[arrayZZLow32.Length - 2], arrayZZHigh32[arrayZZHigh32.Length - 2], arrayLRI32[arrayLRI32.Length - 2]));

}

Print(" ");

**to filter each dataseries one at a time to test values. Regardless of the filter, the red section of code for each respective**

*BarsInProgress = 1***IF blocks still produces incorrect values. The code for the function below is the same code that is producing the values in the databox (Hedge and Trigger) on the right of the image. These values should match and don't.**

*BarsInProgress = X*{

….

}

**object to pull in data into these functions as the code that is correctly returning values. Below is an image that is showing this issue. My custom function and NT8s internal LinearRegressionIntercept() function are both returning incorrect values and I don't understand why.**

*Closes[1]*
## Comment