namespace NinjaTrader.Indicator
{
/// <summary>
/// Fib Retracements
/// </summary>
[Description("Fib Retracements")]
[Gui.Design.DisplayName("Fib2")]
public class Fib2 : Indicator
{
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
#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.Orange, PlotStyle.Line, "Plot0"));
CalculateOnBarClose = true;
Overlay = false;
PriceTypeSupported = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (Close[0] > Close[1])
DrawFibonacciRetracements("Lines" + CurrentBar, 1, High[0], 0, Low[0]);
else if (Close[0] <= Close[1])
DrawFibonacciRetracements("Lines" + CurrentBar, 1, Low[0], 0, High[0]);
}
Thanks.
Comment