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

Lines are not drawing in Indicator panel

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

    Lines are not drawing in Indicator panel

    I went through my logic and printed my loops and it is working correctly, but why are my lines not being drawn on my panel

    Calculate = Calculate.OnBarClose;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = false;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;


    this is my loop


    Draw.HorizontalLine(this,"Horizontal",0,Brushes.Wh ite);

    // Is last bar on chart


    for (int nCount = 1; nCount < drawList.Count - 1; nCount++)
    {
    if (drawList[nCount].PivotType == 1)
    { Print("Pivot1");
    Draw.Line(this,"Long" + nCount.ToString(), false, drawList[nCount].Time,0,drawList[nCount].Time, 10, eLongBrushColor,DashStyleHelper.Solid,nBarWidth);

    }
    else if (drawList[nCount].PivotType == -1)
    {
    Print("Pivot-1");

    Draw.Line(this,"Short" + nCount.ToString(),
    false,
    drawList[nCount].Time,0, drawList[nCount].Time,-10,
    eShortBrushColor,DashStyleHelper.Solid,nBarWidth);


    }

    }


    The print statements of Pivot -1 and Pivot 1 are showing in the output box butthe lines are not showing on the panel

    #2
    Hello ballboy11,

    Thanks for your post.

    Have you verified (Print out) the values of drawList[nCount].Time as well as the other parameters to ensure suitability?

    Are these intended to be vertical lines from a value of 0 to 10 or 0 to -10?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      yes all I am doing is printing vertical lines up and down at certain time points

      Comment


        #4
        Hello ballboy11,

        Thanks for your reply.

        "Have you verified (Print out) the values of drawList[nCount].Time as well as the other parameters to ensure suitability?"

        I created a short test script with similar parameters and it draws as expected.
        Attached Files
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          thanks for some reason I had to uninstall the indicator and reinstall it for it to work but now I have a second question in nt7. This function was to center my chart but this function will not work in NT8 I got this from the Heiken in NT7. Is there a similar function in 8


          public override void GetMinMaxValues(ChartControl chartControl, ref double min, ref double max)
          {
          if (Bars == null || ChartControl == null)
          return;

          for (int idx = FirstBarIndexPainted; idx <= LastBarIndexPainted; idx++)
          {
          double tmpHigh = 10;
          double tmpLow = -10;

          if (tmpHigh != 0 && tmpHigh > max)
          max = tmpHigh;
          if (tmpLow != 0 && tmpLow < min)
          min = tmpLow;
          }
          }

          Comment


            #6
            hello ballboy11,

            Thanks for your reply.

            Please see the helpguide here: http://ninjatrader.com/support/helpG...lateminmax.htm
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thank you very much. It works like a charm.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Christopher_R, Today, 12:29 AM
              0 responses
              9 views
              0 likes
              Last Post Christopher_R  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              166 responses
              2,235 views
              0 likes
              Last Post sidlercom80  
              Started by thread, Yesterday, 11:58 PM
              0 responses
              3 views
              0 likes
              Last Post thread
              by thread
               
              Started by jclose, Yesterday, 09:37 PM
              0 responses
              8 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,415 views
              0 likes
              Last Post Traderontheroad  
              Working...
              X