On the update all values for the stoch are < 25. That is good.
However, the time sometimes repeats. In other words, there are duplicate times with different stoch values.
I load a stoc indicator on the chart and try to match up the chart reading with what is in the output window. Most of the time I can match up the data. Once in a while, I can't. If there is a dup time things go haywire. Sometimes the value on the chart stoch for a given time will not match the output window.
Can someone steer me in the right direction?
protectedoverridevoid Initialize()
{
/// primary chart will be 5 min with index = 0
///15 min chart index=1
Add(PeriodType.Minute,60);
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired)
return;
// Condition set 1
if ((Stochastics(3, 5, 2).K[0] < 25) && (Stochastics(BarsArray[1],3, 5,2).K[0] < 25 ))
{
Print(Time[0].ToString() + " " + Stochastics(3, 5,2).K[0]);
//Print(Stochastics(3, 5,2).K[0]) ;
//Print("");
//Print(wordOne.ToString() + wordTwo.ToString());
DrawDiamond("My diamond" + Close[0], false, 0, Low[0] + -2 * TickSize, Color.Blue);
Thank you,
Duke
Comment