Can someone please explain why tick data and minute data produced different results on the same RSI method ?
- is there a guide available on how to code with tick data correctly?
{
public class rsiquestion : Indicator
{
[Browsable(false)]
[XmlIgnore]
public Series<double> rsiTick
{
get { return Values[0]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> rsiMinute
{
get { return Values[1]; }
}
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "rsiquestion";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
AddPlot(Brushes.Cyan, "RSI tick");
AddPlot(Brushes.Magenta, "RSI Minute");
AddDataSeries("EURAUD", Data.BarsPeriodType.Tick, 1);
AddDataSeries("EURAUD", Data.BarsPeriodType.Minute, 1);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0 && IsFirstTickOfBar)
{
if (CurrentBars[1] < 50)
return;
double rsiValueTick2 = RSI(BarsArray[1], 25, 5)[0];
rsiTick[0] = rsiValueTick2;
double rsiValueMinute2 = RSI(BarsArray[2], 25, 5)[0];
rsiMinute[0] = rsiValueMinute2;
}
}
}
}
// here you can see that the signals are completely different. (its the same with SMA() also )
Why?. Thanks

Comment