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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    578 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X