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
How to force an indicator to recalculate it's values?
Collapse
X
-
How to force an indicator to recalculate it's values?
I have placed some up and dn buttons on the menu bar to change the deviation value for the Zigzag indicator. How can I force the ZigZag indicator to recalculate(). Update() does not do it since everything is already up to date on the current bar.Tags: None
-
Hello boreland,
There are no supported methods to reload a single NinjaScript.
An alternative would be ReloadAllHistoricalData() which will reload all of the historical data for all scripts on a chart including the host strategy (or host indicator).
The indicator method can be called with a different set of parameters and this would generate a new instance of the indicator.
Each time the indicator is called with a specific set of parameters the instance is cached and kept alive in memory until the host instance is disposed.
Calling the indicator with a new set of parameters would cause a new instance to be created that will have to re-process all of the historical data (and real-time data received).
If indicator is being called dynamically in OnBarUpdate(), this would allow you to use the values from this in the strategy as you would like for calculations and conditions.
However the indicator could not be added to the chart with AddChartIndicator() as this is only designed to be called during State.DataLoaded before OnBarUpdate begins processing.
Chelsea B.NinjaTrader Customer Service
-
I added ReloadAllHistoticalData() to:
private void upButton_Click(object sender, RoutedEventArgs e)
{
System.Windows.Controls.Button button = sender as System.Windows.Controls.Button;
if (button != null)
{
DeviationValue = DeviationValue + 0.2;
myTxtBox.Text = DeviationValue.ToString();
ReloadAllHistoricalData();
}
}
but it does not work. Reloading all historical data from the context menu does work however?Last edited by boreland; 04-29-2020, 08:39 AM.
Comment
-
Hi Chelsea,
I saw there is a similar topic active today (a topic relating to ReloadAllHistoricaldata() ) but I did not want to post anything that might disrupt that OPs active thread so posting here.
I am posting to request a feature enhancement to make ReloadAllHistoricaldata() available via Ninjascript calls from
1) OnStateChange() from DataLoaded and later states
2) OnBarUpdate()
For Strategies, Indicators and AddOns.
While searching for a solution I found the following links supporting the idea this is a common need.
hello is it possible to create a button on chart or on toolbar for 'Reload All Historical data" (Ctrl + Shift + R) ? Thanks
Is there a way to force refresh using the option of reload all historical data not just reload ninjascript?
https://ninjatrader.com/support/forum/forum/ninjatrader-8/indicator-development/1065943-tick-refreshhello, I am using tick chart and I want to auto-reload all historical data{indtra day data } after every 15 min, is there any option like that? and dose anyone
Possibly an old related Feature Request, but also possibly complicated with other issues ... https://ninjatrader.com/support/foru...338#post827338
Thanks for your time,
HedgePlay
Comment
-
Hello HedgePlay,
This request to call ReloadAllHistoricalData() outside of OnConnectionStatusUpdate() is being tracked with ID# SFT-1869.
Please note, we receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing, so we cannot offer an ETA or promise of fulfillment.
When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number may be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.
Release Notes - https://ninjatrader.com/support/help...ease_notes.htmChelsea B.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,602 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
12 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment