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

Time estimate

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

    Time estimate

    Good day, please tell me how to compare the time of the opening of the last two bars prices using bartype "range"?

    #2
    Hello Papercut, and thank you for your question.

    With NinjaScript, we do not actually have to filter any data through our bars. We have access to raw, uninterpreted price data. The difference between the price of the last two bars is simply

    Last[0] - Last[1]

    The order I picked is the price of the most recent bar, minus the price of the 2nd most recent bar, so that a positive value means the market is trending upward, and a negative value means the market is trending downward. If you do not care which way the market is trending and just want to know how big the change was, that is

    Math.Abs(Lasts[0] - Last[1])

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JessicaP View Post
      Hello Papercut, and thank you for your question.

      With NinjaScript, we do not actually have to filter any data through our bars. We have access to raw, uninterpreted price data. The difference between the price of the last two bars is simply

      Last[0] - Last[1]

      The order I picked is the price of the most recent bar, minus the price of the 2nd most recent bar, so that a positive value means the market is trending upward, and a negative value means the market is trending downward. If you do not care which way the market is trending and just want to know how big the change was, that is

      Math.Abs(Lasts[0] - Last[1])

      Please let us know if there are any other ways we can help.
      NinjaTrader_JessicaP, thanks a lot!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mizzouman1, Today, 07:35 AM
      4 responses
      18 views
      0 likes
      Last Post Mizzouman1  
      Started by philmg, Today, 01:17 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by cre8able, Today, 01:01 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by manitshah915, Today, 12:59 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by ursavent, Today, 12:54 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X