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 Mestor, 03-10-2023, 01:50 AM
            16 responses
            388 views
            0 likes
            Last Post z.franck  
            Started by rtwave, 04-12-2024, 09:30 AM
            4 responses
            31 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by yertle, Yesterday, 08:38 AM
            7 responses
            29 views
            0 likes
            Last Post yertle
            by yertle
             
            Started by bmartz, 03-12-2024, 06:12 AM
            2 responses
            22 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by funk10101, Today, 12:02 AM
            0 responses
            7 views
            0 likes
            Last Post funk10101  
            Working...
            X