Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText and COBC = False

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

    #16
    Hi aventeren,

    There is code in this script that can change the behavior that was not previously posted.

    You are adding a secondary data series to your script. This means that the code will process once for each series. I would expect there to be more than the expected text boxes on each hour.

    If you are wanting to only plot on one time frame, then you will need to prevent the code from executing on the secondary time frame.

    For example:
    if (BarsInProgress == 1)
    return;
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Thanks, Chelsea.

      I want the labels to be drawn for the secondary time series.

      For instance, let's assume that I have a 15 min chart open (primary chart) and the secondary chart is 60 min. The plots are for the secondary series (i.e., 60 min). I want the labels to plot the 15 min price relationship to the 60 min plot values (i.e., valueSMA, valueStdDev, valueBB2upper, etc).

      Is this possible?

      Thanks,

      Aventeren

      Comment


        #18
        Hello aventeren,

        Sure, you can run this only for the secondary series with:

        if (BarsInProgress == 0)
        return;
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello aventeren,

          Sure, you can run this only for the secondary series with:

          if (BarsInProgress == 0)
          return;
          So where do I place this line of code?

          Comment


            #20
            Hi aventeren,

            Place this code before any code you do not want executed on the primary data series.

            If you want all the code to be run on the secondary data series then place this as the first line in OnBarUpdate.

            This is similar to the if (CurrentBar < BarsRequired) return; check you have. If there aren't enough bars do not execute the code. Similarly if this is not the primary data series do not execute the code.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            116 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            61 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            40 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            43 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            82 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X