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 GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,227 views
            0 likes
            Last Post xiinteractive  
            Started by andrewtrades, Today, 04:57 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            7 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            440 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            11 views
            0 likes
            Last Post FAQtrader  
            Working...
            X