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
Simple Indicator seems to be a Resource Hog
Collapse
X
-
It seems probable you're applying this to too small/fast of a time frame or on too many symbols and charts at a time. Is it running as a column in Market Analyzer? Or, is it on 20 charts all of which are small bars?
Or, after adding it to the chart, are you changing it from its default OnBarClose to OnEachTick or OnPriceChange?
-
Just out of curiosity, how many days have you been running NT? I use 2-3 NQ range charts and I have almost never seen any indicator have more than 1 million ms of CPU time.
Comment
-
Hello JohnS52,
Thanks for your post.
I do not see anything specific in the code you shared that would cause the indicator to use a large number of resources.
Do you have Tick Replay enabled?
As Leeroy_Jenkins stated, how many days have you been running NinjaTrader?
For best performance, we suggest resetting NinjaTrader daily as noted in the help guide page below.
Performance Tips: https://ninjatrader.com/support/help...ance_tips2.htm
As a test, please restart NinjaTrader, then close any workspaces you have open, create a New > Chart window in the blank workspace, add the indicator to the chart, open the NinjaScript Utilization Monitor, and note the number of resources being used.
Do you see the same behavior occur after running this test?
Further, you could find performance tips from our help guide linked above. These tips will help optimize the performance of your platform.Brandon H.NinjaTrader Customer Service
Comment
-
Thanks for your interest and your replies. That was about 24 hours of NT data. No Tick Replay enabled. It's doing it again today. Already 400,000+ms in about 2 hours, running On Price Change on two 30 minute charts. I usually do restarts of NT8 and my computer everyday. I will try and delete the cache and see if that helps.Last edited by JohnS52; 12-04-2023, 09:10 AM.
Comment
-
Do you call this indicator within other indicators/strategies? It seems like it recalculates for all bars on each price change. It happened to me once with my own indicator.
Comment
-
Hello Leeroy, I will have to look into that with a Print function. That could possibly be what's happening. But why would it do that?
But no, I am not using it in any strategies, just the two 30 minute charts. I originally made it because the Lizard amaMacdBB indicator seemed to not work properly with the Markers Plus system: I was trying to simplify it.
Comment
-
Hello JohnS52,
Thanks for your notes.
When working with any issue, it is important to take steps to isolate the issue so that the exact line causing the behavior can be found.
This is a process of elimination and a process of debugging by adding prints.
To see what section of code in the script is causing a large number of resources to be used you could reduce the code of the script and debug by adding prints.
Comment out one section of code at a time and test the script in a blank workspace on a single blank chart with no other indicators, strategies, or custom bar types applied to the chart. If at some point you comment out a section of code and see the behavior stopped, you could debug the script further by adding prints and uncommenting lines of code from the commented out section of code to narrow in on the offending code.Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by JGriff5646, Today, 10:02 PM
|
0 responses
7 views
0 likes
|
Last Post
by JGriff5646
Today, 10:02 PM
|
||
Started by AdamDJ8, Today, 09:18 PM
|
0 responses
3 views
0 likes
|
Last Post
by AdamDJ8
Today, 09:18 PM
|
||
Started by knowmad, Today, 03:52 AM
|
2 responses
29 views
0 likes
|
Last Post
by knowmad
Today, 09:03 PM
|
||
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
11 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
Comment