Thanks in advance.
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
Limiting indicator calculation and display
Collapse
X
-
Limiting indicator calculation and display
Thanks to the assistance of posters in this forum I was finally able to create an indicator that doesn't cause the chart to autoscale to the indicator. This was accomplished by using the DrawLine Method and essentially draw a new line from every bar to the next one. Unfortunately this causes the chart to take an inordinate amount of time to load these indicators when the chart is opened or initiated. So I would like to add a parameter to the indicator that would limit how far back the indicator is calculated. Is there a way to do this?
Thanks in advance.Tags: None
-
Hello ECI-Ed,
There are a number of ways of doing this such as, limited the number of days to load on your chart, use a time filter, or check the number of CurrentBars, etc...JCNinjaTrader Customer Service
-
Hello JC,
Thanks for your reply. I was thinking of something along the lines of CurrentBars. Maybe I'm dense, but I don't quite see how CurrentBars alone can accomplish this. If the bars were numbered backwards from the current bar it would be easy, but could you possibly provide a sample of how to do this with the CurrentBar method? Thanks.
Comment
-
You can use Count to determine exactly how many bars are on the chart, and then create a filter to only calculate on X number of currentbars from the last bar on the chart.
Code:int startBar = Count - 10; if(CurrentBar >= startBar) { Print(CurrentBar); }
MatthewNinjaTrader Product Management
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bmartz, 03-12-2024, 06:12 AM
|
4 responses
31 views
0 likes
|
Last Post
by bmartz
Today, 08:02 AM
|
||
Started by Aviram Y, Today, 05:29 AM
|
4 responses
12 views
0 likes
|
Last Post
by Aviram Y
Today, 07:57 AM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
3 responses
28 views
0 likes
|
Last Post Today, 07:41 AM | ||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:30 AM | ||
Started by cls71, Today, 04:45 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:25 AM |
Comment