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

Bars.BarsSinceSession>2 doesn't work on daily

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

    Bars.BarsSinceSession>2 doesn't work on daily

    Hi,

    I have a condition with Bars.BarsSinceSession>2 that works on intraday charts but doesn't draw on daily?

    Thanks

    #2
    Hello td_910,

    Thank you for the post.

    I wouldn't necessarily expect this to work on a daily bar type specifically as generally you will at most have 1 bar per day. The syntax you have used would need at least 2 bars since the session to become true which will occur on an intraday bar type.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      yes, I know that
      is there something like "IsIntraday" in Ninjascript?

      Comment


        #4
        I would have expected all Bars.BarsSinceSession to give true on a daiy chart
        as BarsSinceSession does make only sense on intraday TFs

        Comment


          #5
          Hello,

          Thank you for the reply.

          If you are using CalculateOnBarClose = false, you could use FirstTickOfBar to set a variable. This could then be used to know the start, you could then use time or tick events to check further conditions after that point.



          Please let me know if I may be of additional assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Originally posted by td_910 View Post
            yes, I know that
            is there something like "IsIntraday" in Ninjascript?
            Try using,

            Code:
            Bars.BarsType.IsIntraday
            which returns True or False.

            To see it in action, search for "IsIntraday" in these files,

            Code:
            @Pivots.cs
            @CurrentDayOHL.cs
            @PriorDayOHLC.cs
            inside your "NinjaTrader 7/bin/Custom/Indicators" folder.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PaulMohn, Today, 03:49 AM
            0 responses
            7 views
            0 likes
            Last Post PaulMohn  
            Started by inanazsocial, Today, 01:15 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by rocketman7, Today, 02:12 AM
            0 responses
            10 views
            0 likes
            Last Post rocketman7  
            Started by dustydbayer, Today, 01:59 AM
            0 responses
            4 views
            0 likes
            Last Post dustydbayer  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            5 responses
            23 views
            0 likes
            Last Post trilliantrader  
            Working...
            X