Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw.text BarsInProgress ==1 on BarsInProgress =0 Bar Height

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

    draw.text BarsInProgress ==1 on BarsInProgress =0 Bar Height

    I have a list of information that I want to draw on the main chart but I need the Low of the main chart not the low on the BarsInProgress = 1 Low;

    This is my line issue Bars.GetLow(Bars.GetBar(drawList[nCount].Time))


    if I try to draw my drawList information when bars in progress is 0 it won't work because I need the algorithm in barsinprogress== 1 to finish.


    Draw.Text(this, "MyCount" + nCount.ToString(), false, "J", drawList[nCount].Time, Bars.GetLow(Bars.GetBar(drawList[nCount].Time)) , 0, Brushes.Yellow, myFont, TextAlignment.Center, Brushes.Transparent, Brushes.Yellow, 0);


    The printing does work but my information is sometimes far away to my candle.

    If I try to print when barsinprogress ==0; my info will not print on screen

    #2
    Hello ballboy11,

    Thanks for opening the thread.

    You could use BarsArray[0] to explicitly reference the Bars object for the primary data series.

    BarsArray[0].GetLow(BarsArray[0].GetBar(drawList[nCount].Time))

    Publicly available documentation can be found below.

    BarsArray - https://ninjatrader.com/support/help.../barsarray.htm

    If you have any additional questions, please don't hesitate to ask.

    Comment


      #3
      Thanks I am not sure if it worked but this actually helps me wit hother scenario

      Comment


        #4
        Hello ballboy11,

        Without the full context of the code I can only speculate on what the issue may be.

        To assist you further I have attached some sample code demonstrating Draw.Text() being called from from BarsInProgress 1 (BIP1) with the Close from BIP1 so it is drawn in relation to the bars on BIP0.

        Code:
        protected override void OnStateChange()
        {
        	if (State == State.SetDefaults)
        	{
        		...
        	}
        	else if (State == State.Configure)
        	{
        		AddDataSeries(BarsPeriodType.Second, 5);
        	}
        }
        
        protected override void OnBarUpdate()
        {
        	if(CurrentBars[0] < 1 || CurrentBars[1] < 1)
        		return;
        	if(BarsInProgress == 1)
        	{
        		Draw.Text(this, "MyCount" + CurrentBars[0].ToString(), false, Close[0].ToString(), Times[0][0], BarsArray[0].GetLow(BarsArray[0].GetBar(Times[0][0])), 10, Brushes.Green, ChartControl.Properties.LabelFont, TextAlignment.Center, Brushes.Transparent, Brushes.Yellow, 0);
        	}
        }
        Further information on how each price/time series should be referenced can be found in the Multi Series NinjaScript documentation which provides a complete guide for creating and using Multi Series NinjaScripts.

        Multi Series NinjaScripts - https://ninjatrader.com/support/help...nstruments.htm

        If there is anything else we can do to help, please let us know.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X