Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

custom indicator values in Analyzer differ

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    custom indicator values in Analyzer differ

    Hi

    my custom indicator cross over values either dont show or show incorrectly in analyzer for the same time frame, hope you can help. Image of EURGBP shows the cross overs from indicator and column definition yet no signals in analyzer on the right. the code is simply

    #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>
    /// Ichimoku Crosses
    /// </summary>
    [Description("Ichimoku Crosses")]
    public class aaIchimokuCross : Indicator
    {
    #region Variables
    // Wizard generated variables
    // 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()
    {
    Overlay = false;
    DisplayInDataBox = true;
    Add(new Plot(Color.FromKnownColor(KnownColor.Violet), PlotStyle.Line, "Cross"));
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (CrossAbove(IchimokuBasic(9, 26, 52).TenkanSen, IchimokuBasic(9, 26, 52).KijunSen, 1))
    {
    BackColorAll = Color.LightGreen;
    Cross.Set(1);
    // DrawTriangleUp("My triangle up" + CurrentBar, false, 0, 0, Color.Lime);
    }

    // Condition set 2
    if (CrossBelow(IchimokuBasic(9, 26, 52).TenkanSen, IchimokuBasic(9, 26, 52).KijunSen, 1))
    {
    BackColorAll = Color.Violet;
    // DrawArrowDown("My down arrow" + CurrentBar, false, 0, 0, Color.Red);
    Cross.Set(-1);
    }
    }

    #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 Cross
    {
    get { return Values[0]; }
    }

    #endregion
    }
    }

    the indicator plots correctly on the chart

    Thanks in advance
    Juan
    Attached Files

    #2
    Juan, can you please ensure the session templates are identical for the Chart / Market Analyzer and also please try with a higher bars back setting, for the chart you likely have more than 50 bars loaded, yet this is what you do on the MarketAnalyzer.

    Also, please check the CalculateOnBarClose setting is the same for chart vs Market Analyzer.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand

      I cant see a Session template in the column definition section, the indicator is Default 24/7 . Enlarging the lookback period doesnt show the latest signals either which is what i would expect if ninja looks from the last bar backwards which is what i would expect, if you can confirm this is how it works?. attached screenshot from data series for EURUSD. The calculate on bar close is set to false on both. Any further ideas?

      many thanks
      Juan
      Attached Files

      Comment


        #4
        Yes, the session template can be set in the MA as well, but not per column but for the full MA, so right click in the MA sheet and set it as needed in it's properties and then recheck. The larger lookback would be needed, it would work from the left most bar to the current one and not the other way - so you would still see current signals on the current most bar being evaluated with CalculateOnBarClose = true.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          hi

          have set the ma to 980 bars lookback default 24/7 session template, my chart displays 10 days in 30 min increments. still doesnt work shows none for some instruments and incorrect entries for others. Cant beleive a simple cross over can be this complicated, any other thoughts?

          thanks
          juan

          Comment


            #6
            Hi Juan, if you for example compare the indicator values directly for the MA vs Chart - let's say for a SMA would those match up as you expect?

            If possible, you can email me as well directly under support at ninjatrader dot com and attach the setup that you use, I will then give this a run to compare on our end.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,403 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            94 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X