Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Can I lighten CPU load this way?
Collapse
X
-
Can I lighten CPU load this way?
Back when I was using TradeStation there was a trick to save some CPU cycles in coding and I would like to see if it would work in NT (if I understand OnBarUpdate() correctly). This applies to CalculateOnBarClose = false; If OnBarUpdate() is "true" even if more volume comes in at the same price (changing Volume[0] but not Close[0]), then if I just check for a change in Close[0], I can skip the indicator calculations on all indicators THAT USE PRICE ONLY (not Volume) by immediately issuing a "return;" in the code. Of course, during highly volatile times Close[0] changes constantly, so not any savings there, but in "normal" times it might help - if it worked that way. Does it?Tags: None
-
Sorry - I was specifically looking at this for minimizing calc time on my TPO chart (where I also have to account for the Initial Balance time if Close[0] doesn't change at that particular moment). For other indicators I'm not sure how it would work, though if the indicator is using # of bars (like an Average) you would obviously have to account for the new bar in the Average length (maybe using FirstTickOfBar or a counter as a flag...)
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by futtrader, 04-21-2024, 01:50 AM
|
4 responses
41 views
0 likes
|
Last Post
by futtrader
Today, 03:01 PM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
1 response
11 views
0 likes
|
Last Post
by bltdavid
Today, 02:44 PM
|
||
Started by port119, Today, 02:43 PM
|
0 responses
1 view
0 likes
|
Last Post
by port119
Today, 02:43 PM
|
||
Started by Philippe56140, Today, 02:35 PM
|
0 responses
3 views
0 likes
|
Last Post Today, 02:35 PM | ||
Started by 00nevest, Today, 02:27 PM
|
0 responses
2 views
0 likes
|
Last Post
by 00nevest
Today, 02:27 PM
|
Comment