Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Draw.Text conflict with right side margin

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

    Draw.Text conflict with right side margin

    I have an indicator that adds numbers either above or below the price bar during specific conditions. I have an issue with the chart randomly adding a significant amount of right side margin. My chart margin is only set to 10. This happens quite frequently. Once in this state it generally does not go away unless I touch the right side margin parameter value, turn on/off the indicator, or restore/maximize the chart window. The problem also goes away if I change the scale justification of the indicator to Left. But I don't want a left scale on my chart.

    I have narrowed this down to what appears to be an issue with the Draw.Text method. Please see a test indicator example below that replicates the issue. You might have to refresh multiple times (F5) before you see it. The attached screenshot demonstrates the problem. It does not occur if the Draw.Text is not applied on the last 50 or so bars.

    Any help would be appreciated. Thanks.

    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.DrawingTools;
    #endregion

    //This namespace holds Indicators in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.Indicators
    {
    public class TEXTTEST : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "TEXTTEST";
    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)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    Draw.Text(this,"" + CurrentBar, "1", 0, Open[0]);
    }
    }
    }
    Attached Files

    #2
    Also occurs with Draw.Ray

    I discovered this also happens using Draw.Ray. See attached example.
    Attached Files

    Comment


      #3
      Hello mvdn73,

      What version of NT8 are you running under Help>About?

      I look forward to your reply.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        8.0.8.0 64-bit (Standard).

        Comment


          #5
          Hello mvdn73,

          I was able to replicate and have forwarded this to development in the form of a bug report.

          Thank you for reporting this.
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Thanks, is it possibly for me to track priority and/or progress of a bug?

            Comment


              #7
              Hello mvdn73,

              Yes, I will follow up with you when it has been assigned a tracking number.

              Thank you for your patience.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                Hello,

                The issue has been assigned an ID 12032.

                When the issue is resolved you will see this listed in the release notes of the helpguide.

                Please let us know if you need further assistance.
                Alan P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                40 views
                0 likes
                Last Post jeronymite  
                Started by bill2023, Today, 08:51 AM
                2 responses
                16 views
                0 likes
                Last Post bill2023  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                167 responses
                2,260 views
                0 likes
                Last Post jeronymite  
                Started by warreng86, 11-10-2020, 02:04 PM
                7 responses
                1,362 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Perr0Grande, Today, 08:16 PM
                0 responses
                5 views
                0 likes
                Last Post Perr0Grande  
                Working...
                X