• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 rouillard, Today, 03:34 PM
    2 responses
    14 views
    0 likes
    Last Post rouillard  
    Started by mquinteroj, Today, 02:41 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by JPPoulin, Today, 01:32 PM
    4 responses
    15 views
    0 likes
    Last Post JPPoulin  
    Started by bltdavid, Today, 01:09 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by pstrusi, Today, 12:50 PM
    2 responses
    8 views
    0 likes
    Last Post pstrusi
    by pstrusi
     
    Working...
    X