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 AttiM, 02-14-2024, 05:20 PM
            12 responses
            213 views
            0 likes
            Last Post DrakeiJosh  
            Started by cre8able, 02-11-2023, 05:43 PM
            3 responses
            237 views
            0 likes
            Last Post rhubear
            by rhubear
             
            Started by frslvr, 04-11-2024, 07:26 AM
            8 responses
            116 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by stafe, 04-15-2024, 08:34 PM
            10 responses
            47 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by rocketman7, Today, 09:41 AM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X