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

Price churn within a bar

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

    Price churn within a bar

    Anyone got any ideas on how to program an indicator that will detect price on a tick basis that is bouncing say <> 3 or 4 ticks and when it happens, increment a counter?

    I have tried using MarketDataType.Last and then ePrice but you can't use barsAgo with ePrice.

    Is the close equivalent to Last on a tick basis?

    If so, then the Close[0] > Close[1] || Close[0] < Close[1] could be used to increment the counter.

    Any advice appreciated.

    Thanks

    #2
    Originally posted by gdavis74 View Post
    Anyone got any ideas on how to program an indicator that will detect price on a tick basis that is bouncing say <> 3 or 4 ticks and when it happens, increment a counter?

    I have tried using MarketDataType.Last and then ePrice but you can't use barsAgo with ePrice.

    Is the close equivalent to Last on a tick basis?

    If so, then the Close[0] > Close[1] || Close[0] < Close[1] could be used to increment the counter.

    Any advice appreciated.

    Thanks
    Okay - thinking outside your requirement - have you tried NT's range bars?

    Comment


      #3
      Hello gdavis74,

      If you are using CalculateOnBarClose (COBC) false, then yes "Close[0]" is going to be the most current tick data coming in.

      If your strategy requires the use of COBC true, then you may try using "Close[0]" inside of OnMarketData() so that you may get the Close price of the last completed bar while the current bar is being formed.

      Let me know if we can be of further assistance.
      JCNinjaTrader Customer Service

      Comment


        #4
        Ok, then Close will work because this indicator would not use COBC true. Thanks much!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        2 responses
        12 views
        0 likes
        Last Post alifarahani  
        Started by junkone, Today, 11:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by pickmyonlineclass, Today, 12:23 PM
        0 responses
        1 view
        0 likes
        Last Post pickmyonlineclass  
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        44 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X