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

Question with general function

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

    Question with general function

    I just wanted to see what happens by using

    Code:
    Print("Input 0 is: " + Close[0]);
    Print("Input 1 is: " + Close[1]);
    Why does the code return:

    Input 1 is: 1385
    Input 0 is: 1384.5
    Input 1 is: 1384.5
    Input 0 is: 1384
    Input 1 is: 1384.5
    Input 0 is: 1383.75
    Input 1 is: 1384
    Input 0 is: 1383.25
    Input 1 is: 1383.75
    Input 0 is: 1382.75
    Input 1 is: 1383.25
    Input 0 is: 1383.75
    Input 1 is: 1382.75
    Input 0 is: 1383.75
    Input 1 is: 1383.75
    Input 0 is: 1383.75
    Input 1 is: 1383.75
    Input 0 is: 1383
    Input 1 is: 1383.75
    Input 0 is: 1382.5
    Input 1 is: 1383
    Input 0 is: 1383.5
    Input 1 is: 1382.5
    Input 0 is: 1384
    Input 1 is: 1383.5
    Input 0 is: 1384
    Input 1 is: 1384
    Input 0 is: 1384.25
    Input 1 is: 1384
    Input 0 is: 1384
    Input 1 is: 1384.25
    Input 0 is: 1382.75
    Input 1 is: 1384
    And so on... will it always go through each bar of data? are there ways to optimize this to be more efficient?

    #2
    Originally posted by Maciek View Post
    I just wanted to see what happens by using

    Code:
    Print("Input 0 is: " + Close[0]);
    Print("Input 1 is: " + Close[1]);
    Why does the code return:



    And so on... will it always go through each bar of data? are there ways to optimize this to be more efficient?
    A data stream is called such because it flows through from beginning to end, just like the object in life that it is named after; a stream. If you do not want to process historical bars, you can use the Historical property in NT.

    ref: http://www.ninjatrader.com/support/h...historical.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    4 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    241 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X