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 TraderG23, 12-08-2023, 07:56 AM
            9 responses
            382 views
            1 like
            Last Post Gavini
            by Gavini
             
            Started by oviejo, Today, 12:28 AM
            0 responses
            1 view
            0 likes
            Last Post oviejo
            by oviejo
             
            Started by pechtri, 06-22-2023, 02:31 AM
            10 responses
            125 views
            0 likes
            Last Post Leeroy_Jenkins  
            Started by judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Yesterday, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Working...
            X