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 samish18, Today, 08:31 AM
            0 responses
            0 views
            0 likes
            Last Post samish18  
            Started by RookieTrader, Today, 07:41 AM
            2 responses
            7 views
            0 likes
            Last Post RookieTrader  
            Started by kujista, Today, 05:44 AM
            2 responses
            13 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by trilliantrader, Today, 08:16 AM
            0 responses
            3 views
            0 likes
            Last Post trilliantrader  
            Started by AttiM, 02-14-2024, 05:20 PM
            9 responses
            175 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X