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

Double value 1 bar ago

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

    Double value 1 bar ago

    Hi,
    For my indicator I only need double value from today and yesterday, so I need to access double value 1 bar ago. Can I do it not through DataSeries?
    Thank you

    #2
    Hello Tatiana,

    You may get a previous bars value by using a DataSeries using the brackets to get the previous bars value. Here is a post that you may view that has some examples of this.


    Note that to get the previous days value you will either have to only set the DataSeries on each new trading day or by getting the Bar number of the value that you would like to get.

    Let me know if you have any questions.
    JCNinjaTrader Customer Service

    Comment


      #3
      So, there is no "special" double that can store yesterday value? Can I have an example how to access double value by getting the Bar number of the value? Thank you in advance

      Comment


        #4
        Hello Tatiana,

        No, there is not special double that stores yesterdays value.

        Here is an example of how this can be done that you may view.

        To Import
        1. Download the attached file to your desktop
        2. From the Control Center window select the menu File > Utilities > Import NinjaScript
        3. Select the downloaded file

        Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.

        Happy to be of further assistance.
        Attached Files
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        7 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Working...
        X