Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja trader possible laging

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

    Ninja trader possible laging

    Just a query on indicators not needing help with code
    I understand "onbarclose" reduces the possibility of lag in data loading. I have a time zone indicator that calculates onbarclose;

    My question is can it still cause lag?

    And If so, if i change that for a very simple line of code to paint the background color for that time i require instead

    Would that reduce any little lag?

    I have a few custom indicators that require calculate oneachtick; and ive noticed a minor slow down in data loading.

    #2
    Hello Christopher Leggit,

    The Calculate setting controls how often the logic in OnBarUpdate is evaluated. With OnBarClose the logic is only evaluated when the bar closes. With OnPriceChange the logic is evaluated for every price change. With OnEachTick the logic is evaluated for every tick.

    The more cycles the logic is evaluated, the more work the CPU has to do.

    Any script with heavy computation can cause high CPU resource use. (For example an infinite while loop will just freeze the computer core instantly with just two lines of code)

    Where you have inquired:
    if i change that for a very simple line of code to paint the background color for that time i require instead
    I'm not quite sure what you are asking.

    However if you are asking if setting the BackBrush is high resource use, this in itself would not be. But doing any action a few thousand times a second would cause high resource use. So if you are setting the BackBrush once per bar, no, this would not be resource intensive.

    Below is a link to a forum post that discusses performance.
    Hello All, I am using NT8 8.0.17.2. My workspace has been essentially static for more then six months, meaning no new indicators or growth in windows open or
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    331 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
    549 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    550 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X