I tried creating my own and it sort of did it except my price axis isnt returning 0-100 its matching the ES symbol values near 1000 today.
I had no problem coding a lot fot my tradestation charts, but this I cant figure out yet.
HELP.
Thanks.
I am posting what I got from ninja's create RSI with all the items expanded to be visible.
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
[Description("The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg ")]
public class RSImine : Indicator
{
#region Variables
// Wizard generated variables
private int myInput0 = 21; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
private DataSeries avgUp;
private DataSeries avgDown;
private DataSeries down;
private int period = 21;
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
Add(new Line(System.Drawing.Color.DarkViolet, 50, "Mid"));
CalculateOnBarClose = false;
PriceTypeSupported = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(Close[0]);
}
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Plot0
{
get { return Values[0]; }
}
[Description("")]
[Category("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}
}
#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private RSImine[] cacheRSImine = null;
private static RSImine checkRSImine = new RSImine();
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
/// <returns></returns>
public RSImine RSImine(int myInput0)
{
return RSImine(Input, myInput0);
}
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
/// <returns></returns>
public RSImine RSImine(Data.IDataSeries input, int myInput0)
{
checkRSImine.MyInput0 = myInput0;
myInput0 = checkRSImine.MyInput0;
if (cacheRSImine != null)
for (int idx = 0; idx < cacheRSImine.Length; idx++)
if (cacheRSImine[idx].MyInput0 == myInput0 && cacheRSImine[idx].EqualsInput(input))
return cacheRSImine[idx];
RSImine indicator = new RSImine();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
indicator.Input = input;
indicator.MyInput0 = myInput0;
indicator.SetUp();
RSImine[] tmp = new RSImine[cacheRSImine == null ? 1 : cacheRSImine.Length + 1];
if (cacheRSImine != null)
cacheRSImine.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheRSImine = tmp;
Indicators.Add(indicator);
return indicator;
}
}
}
// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RSImine RSImine(int myInput0)
{
return _indicator.RSImine(Input, myInput0);
}
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
/// <returns></returns>
public Indicator.RSImine RSImine(Data.IDataSeries input, int myInput0)
{
return _indicator.RSImine(input, myInput0);
}
}
}
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.RSImine RSImine(int myInput0)
{
return _indicator.RSImine(Input, myInput0);
}
/// <summary>
/// The RSI (Relative Strength Index) is a price-following oscillator that ranges between 0 and 100. Input period=14 and a midline=50 and no Avg
/// </summary>
/// <returns></returns>
public Indicator.RSImine RSImine(Data.IDataSeries input, int myInput0)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
return _indicator.RSImine(input, myInput0);
}
}
}
#endregion
Comment