NexusFi: Find Your Edge


Home Menu

 





Call Reload NinjaScript (F5) as a function.


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one wavey with 3 posts (0 thanks)
    2. looks_two ozatrading with 3 posts (0 thanks)
    3. looks_3 hedgeplay with 2 posts (0 thanks)
    4. looks_4 bdnt with 2 posts (2 thanks)
      Best Posters
    1. looks_one cvetkisa with 2 thanks per post
    2. looks_two bdnt with 1 thanks per post
    3. looks_3 Big Mike with 1 thanks per post
    4. looks_4 ktrader with 1 thanks per post
    1. trending_up 5,389 views
    2. thumb_up 6 thanks given
    3. group 9 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread
  #11 (permalink)
 wavey 
Germany / Italy
 
Experience: Advanced
Platform: NT8, TS, TV
Trading: Index Futures, FX
Posts: 87 since Nov 2009
Thanks Given: 52
Thanks Received: 37

Has anyone managed to trigger a daily reload call using script only? i.e. set a time early in the morning refresh data once and continue. So a reload once per session at a given time.


Reply With Quote
  #12 (permalink)
 hedgeplay 
Austin Texas / US
 
Experience: Intermediate
Frequency: Several times daily
Duration: Seconds
Posts: 206 since Dec 2019
Thanks Given: 150
Thanks Received: 226


wavey View Post
Has anyone managed to trigger a daily reload call using script only? i.e. set a time early in the morning refresh data once and continue. So a reload once per session at a given time.

This answer from the previous page seems promising .. if it can process SendKey for F5 can you also use this approach to reload data with the multi-key sequence CTRL-SHIFT-R to reload the data?
 
Code
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));
Earlier posts in this thread speak to a NT7 approach that might still work.

The only other way I have seen mentioned is using an external test or automation tool (one being the hacky AutoHotKey) and using that to SendKey F5 to reload Ninjascript and SendKey CTRL-SHIFT-R to reload the data.

hedge


Reply With Quote
  #13 (permalink)
 wavey 
Germany / Italy
 
Experience: Advanced
Platform: NT8, TS, TV
Trading: Index Futures, FX
Posts: 87 since Nov 2009
Thanks Given: 52
Thanks Received: 37

Thanks yea either this through key or programmatic ReloadAllHistoricalData(). Main thinking was around making sure you only do it once per day at a specific time, lets say before you started the strategy time window for executions. Working on an approach to save last reload day to a file, so new instance after reload would know it has already reloaded for the day, otherwise the variable state would be nuked with the reload and you could be caught in a tailspin of reloading action (uncool lol).


Reply With Quote
  #14 (permalink)
 wavey 
Germany / Italy
 
Experience: Advanced
Platform: NT8, TS, TV
Trading: Index Futures, FX
Posts: 87 since Nov 2009
Thanks Given: 52
Thanks Received: 37

Doing it through text file simply to serve as reload memory seems to work well. Will continue to check and finetune.


Reply With Quote
  #15 (permalink)
 hedgeplay 
Austin Texas / US
 
Experience: Intermediate
Frequency: Several times daily
Duration: Seconds
Posts: 206 since Dec 2019
Thanks Given: 150
Thanks Received: 226


wavey View Post
Thanks yea either this through key or programmatic ReloadAllHistoricalData(). ... .

Why not through that into a simple AddOn that runs once in the background every day... set and forget..

Another related post ..


Reply With Quote




Last Updated on April 29, 2025


© 2025 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts