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

Questions concerning "count & index"

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

    Questions concerning "count & index"

    I have questions about "count & index" that I could use some help on.

    "Code snippets" has the following...


    for (int index = 0; index < count; index++)


    My Questions

    1.) Does (index = 0) equal the most recent bar closed?

    2.) If count = 20, does the above statement retrieve the last 20 index values?

    3.) If "count" equals number of bars, what does "index" represent?


    The only info I could find that may relate to any of these was in NT0019.

    NT0019
    The following NT0019 error code information is provided within the context of NinjaScript. The examples provided is only a subset of potential problems that this error code may reflect. In any case, the examples below provide a reference of coding flaw possibilities.


    Error Code Explanation
    This error can happen when a DataSeries is compared to another object via the use of relational operators. Relational operators (==, <, >, <=, >=) can be used to compare the values of the DataSeries but not the DataSeries object itself.


    To fix this error ensure that you are actually comparing the values of the DataSeries to another object. You can do this by adding the index value to the DataSeries call. The index value is on a zero-based referencing system. [0] references the latest bar while [1] references one bar ago and [2] references two bars ago.

    If I could get answers to these 3 questions, it would help alot.

    Thanks,

    RJay
    Last edited by RJay; 07-10-2008, 12:23 PM.
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    #2
    This is just a template for a for loop. Index and count are just variables that represent the iteration of the loop and the number of iterations. They can mean anything.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Aviram Y, Today, 05:29 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by TradeForge, Today, 02:09 AM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by elirion, Today, 01:36 AM
    2 responses
    14 views
    0 likes
    Last Post elirion
    by elirion
     
    Working...
    X