Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Call Reload NinjaScript (F5) as a function.
Updated July 11, 2023
Top Posters
looks_one
ozatrading
with 3 posts (0 thanks)
looks_two
bdnt
with 2 posts (2 thanks)
looks_3
ktrader
with 1 posts (1 thanks)
looks_4
shazzmoe
with 1 posts (0 thanks)
Best Posters
looks_one
cvetkisa
with 2 thanks per post
looks_two
bdnt
with 1 thanks per post
looks_3
ktrader
with 1 thanks per post
looks_4
Big Mike
with 1 thanks per post
trending_up
4,846 views
thumb_up
6 thanks given
group
5 followers
forum
9 posts
attach_file
0 attachments
Call Reload NinjaScript (F5) as a function.
September 12th, 2013, 10:51 AM
washington+dc/usa
Experience: Intermediate
Platform: NinjaTrader
Trading: cocoa, sugar
Posts: 8 since Dec 2012
Thanks Given: 0
Thanks Received: 0
I need to call reload ninjascript AKA default "F5". Ninjatrader does not support that automatically. I was wondering if anyone had made this code. Please share. Thank you.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
September 12th, 2013, 03:46 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,471 since Jun 2009
Thanks Given: 33,250
Thanks Received: 101,674
ozatrading
I need to call
reload ninjascript AKA default "F5".
Ninjatrader does not support that automatically. I was wondering if anyone had made this code. Please share. Thank you.
Probably closest you will get is using SendKey to send an F5 keyboard press.
Mike
September 12th, 2013, 06:37 PM
washington+dc/usa
Experience: Intermediate
Platform: NinjaTrader
Trading: cocoa, sugar
Posts: 8 since Dec 2012
Thanks Given: 0
Thanks Received: 0
Big Mike
Probably closest you will get is using SendKey to send an F5 keyboard press.
Mike
Yes u right, but it is working only for the ACTIVE window. Does not work for multi-workspaces. If anyone found a solution besides the SendKey. Please answer. Thx Mike. Thx Guys. Great FORUM!!!.
September 13th, 2013, 05:19 AM
glostrup, denmark
Experience: Advanced
Platform: Custom platform
Broker: CQG
Trading: Futures, Options, Stocks
Posts: 249 since Aug 2011
Thanks Given: 152
Thanks Received: 275
ozatrading
I need to call
reload ninjascript AKA default "F5".
Ninjatrader does not support that automatically. I was wondering if anyone had made this code. Please share. Thank you.
Yes, you can use the HistoricalDataManager to load dataseries.
Heres an example of how to load the first dataseries of the currentchart this specific example must be in an indicator because of how it obtains the bar-dataseries to reload, but you can use the datamanager from anywhere and use any barseries).
Since the method gets an ArrayList you can ofcourse reload multiple series with the same call (just add each to the arraylist - for instance loop through the BarsArray of the ChartControl and add each to reload all dataseries of the current chart (this is what "F5" does)
Code
Bars b = this.ChartControl.BarsArray[0];
ArrayList br = new ArrayList();
DateTime f =b.From;
DateTime t =b.To;
if (b.Count>0 && b.GetTime(0)<b.From) f=b.GetTime(0).Date;
if (b.Count>0 && b.GetTime(b.Count-1)>b.To)t=b.GetTime(b.Count-1).Date;
HistoricalDataManager.BarsRequested barsToLoad = new HistoricalDataManager.BarsRequested(b.Instrument, b.Period, f,t) {
Session = b.Session
};
br.Add(barsToLoad);
new HistoricalDataManager.RequestBarsFromProvider(null).DoReloadFromProvider(br);
--ktrader
September 13th, 2013, 08:33 AM
washington+dc/usa
Experience: Intermediate
Platform: NinjaTrader
Trading: cocoa, sugar
Posts: 8 since Dec 2012
Thanks Given: 0
Thanks Received: 0
ktrader
Yes, you can use the HistoricalDataManager to load dataseries.
Heres an example of how to load the first dataseries of the currentchart this specific example must be in an indicator because of how it obtains the bar-dataseries to
reload , but you can use the datamanager from anywhere and use any barseries).
Since the method gets an ArrayList you can ofcourse reload multiple series with the same call (just add each to the arraylist - for instance loop through the BarsArray of the ChartControl and add each to reload all dataseries of the current chart (this is what "F5" does)
Code
Bars b = this.ChartControl.BarsArray[0];
ArrayList br = new ArrayList();
DateTime f =b.From;
DateTime t =b.To;
if (b.Count>0 && b.GetTime(0)<b.From) f=b.GetTime(0).Date;
if (b.Count>0 && b.GetTime(b.Count-1)>b.To)t=b.GetTime(b.Count-1).Date;
HistoricalDataManager.BarsRequested barsToLoad = new HistoricalDataManager.BarsRequested(b.Instrument, b.Period, f,t) {
Session = b.Session
};
br.Add(barsToLoad);
new HistoricalDataManager.RequestBarsFromProvider(null).DoReloadFromProvider(br);
--ktrader
will work around that. thanks for the code!
February 15th, 2018, 12:03 PM
United Kingdom
Experience: Advanced
Platform: NinjaTrader
Trading: EUR/USD
Posts: 3 since Sep 2011
Thanks Given: 0
Thanks Received: 7
ChartControl.HotKey((Keys) HotKeyManager.ChartHotKeys.ReloadNinjaScript);
October 29th, 2018, 11:26 AM
Denver Colorado
Experience: Advanced
Platform: NinjaTrader
Trading: ES
Posts: 10 since Aug 2012
Thanks Given: 0
Thanks Received: 3
has anyone found a way to reload NinjaScript without using a send key in NT8?
I've run into issues where the chart window loses focus and it sends the F5 key press to another window
May 16th, 2023, 10:45 PM
Boston MA USA
Posts: 2 since May 2023
Thanks Given: 0
Thanks Received: 2
I needed this as well, and found this undocumented way...
ChartControl.OnReloadNinjaScriptHotKey(this, new System.Windows.Input.KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(chartControl), 0, Key.F5));
May 23rd, 2023, 05:39 AM
Zaanstad, Netherlands
Posts: 21 since May 2023
Thanks Given: 0
Thanks Received: 8
What about calling the function ForceRefresh()? You can read about it on the NinjaTrader website
July 11th, 2023, 02:31 AM
Boston MA USA
Posts: 2 since May 2023
Thanks Given: 0
Thanks Received: 2
cmelody
What about calling the function ForceRefresh()? You can read about it on the
NinjaTrader website
ForceRefresh only triggers the visuals to re-render, it does not reload the scripts/indicators/strategies running the chart.
Last Updated on July 11, 2023