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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    160 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    308 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    245 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    349 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X