Sorry for starting a new thread, its been over a week since I last made a post on this issue. I had to go out of state for a week and I have returned, performing more tests to iron out what is going on.
As a refresher, I have a data series using a custom RENKO bar that is defined as follows:
else if (State == State.Configure)
{
//AddRenko(null, 8, MarketDataType.Last);
AddDataSeries(null, new BarsPeriod { BarsPeriodType = (BarsPeriodType)1995, Value = 8, Value2 = 3, BaseBarsPeriodValue = 50, MarketDataType = MarketDataType.Last});
}
I now have the following section of code that is producing the results in the attached image:
if (BarsInProgress == 1)
{
eCloseHolder = Closes[1][0];
extClose[0] = eCloseHolder;
double thTrend = 0;
double thHammer = 0;
jelTHExt(ref thTrend, ref thHammer, Closes[1], CurrentBar);
extHammer[0] = thHammer;
extTrend[0] = thTrend;
Print ("thHammer: " + thHammer.ToString() + " ** " + extHammer[0].ToString() + " | thTrend: " + thTrend.ToString() + " ** " + extTrend[0].ToString());
Print ("thHammer[0]: " + extHammer[0].ToString() + " thHammer[1] " + extHammer[1].ToString());
double tmpTHDir = 0;
if (extTrend[0] > extTrend[1])
{
tmpTHDir = 2;
if (extTrend[0] < 0) tmpTHDir = 1;
}
if (extTrend[0] < extTrend[1])
{
tmpTHDir = -2;
if (extTrend[0] > 0) tmpTHDir = -1;
}
Print("dir: " + tmpTHDir.ToString());
if (tmpTHDir < 0) extDirTH[0] = -1;
if (tmpTHDir > 0) extDirTH[0] = 1;
Print("******************************************* **SECONDARY CLOSE: " + Closes[1][0].ToString() + "******************************************");
Print("************* TH-DIR: " + extDirTH[0].ToString());
}
On the bright side, I think we are getting closer. All I need now to return previous values calculated from my function.
Comment