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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    157 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    91 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    143 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X