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 Rapine Heihei, Today, 08:19 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Rapine Heihei, Today, 08:25 PM
            0 responses
            6 views
            0 likes
            Last Post Rapine Heihei  
            Started by f.saeidi, Today, 08:01 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Rapine Heihei, Today, 07:51 PM
            0 responses
            8 views
            0 likes
            Last Post Rapine Heihei  
            Started by frslvr, 04-11-2024, 07:26 AM
            5 responses
            98 views
            1 like
            Last Post caryc123  
            Working...
            X