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

How to determine when a vertical gridline has been crossed (on a Tick Chart)?

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

    How to determine when a vertical gridline has been crossed (on a Tick Chart)?

    If you pop up a tick chart, let's say 200 ticks, then there are these vertical grid lines every so often.

    Is there any way to know programatically when a new line has been drawn?

    e.g. in a time chart you would just know it occurs every so many minutes... but I have no idea how to know in tick chart.

    I want my strategy to know when a vertical grind line on a tick chart has been crossed.

    #2
    Hm? My vertical grid spacing is based on how many bars have passed. There is a new line every 6 bars (so it would be bar 1,2,3,4,5,line with bar 6,1,2,3,4,5,line&6).

    This is the case regardless of time interval of the chart.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      how do you know if you are on bar 2 or 5 for example of the 6? and how do you programatically determine the interval is 6 bars?

      Comment


        #4
        You can do math based off of the CurrentBar property. I don't know why you would need to programmatically determine the spacing is 6 bars? That is just the way NinjaTrader was designed to place that spacing for the vertical gridlines.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          thanks, just a simple way to exit the trades on non-time based charts.

          Comment


            #6
            Ok. Well the lines are based off of number of bars and not a time/tick interval so my previous suggestion about some math with CurrentBar should do.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cls71, Today, 04:45 AM
            0 responses
            1 view
            0 likes
            Last Post cls71
            by cls71
             
            Started by mjairg, 07-20-2023, 11:57 PM
            3 responses
            213 views
            1 like
            Last Post PaulMohn  
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            4 responses
            544 views
            0 likes
            Last Post PaulMohn  
            Started by GLFX005, Today, 03:23 AM
            0 responses
            3 views
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            12 views
            0 likes
            Last Post XXtrader  
            Working...
            X