How to start background process in NT 8 when Control Panel start? - futures io
futures io futures trading



How to start background process in NT 8 when Control Panel start?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vantojo with 3 posts (0 thanks)
    2. looks_two sam028 with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 zweistein with 1 posts (0 thanks)
    1. trending_up 1,652 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

How to start background process in NT 8 when Control Panel start?

(login for full post details)
  #1 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received

Hello,

Does anyone have code samples of how to write a NT 8 AddOn that will start with Ninjatrader Control Panel?

I now have background processes running OK in NT7. But never really liked the restrictions placed by the NT 7 architecture for such processing requirements.

One process is is for internal/external messaging via MSMQ and XMPP servers the other is a one time (load internal static lists from SQL). Neither connects to a data stream from the broker.

If someone has a code sample I can study it will save me hours of wading through documentation looking for the answer.

Many Thanks!

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(167 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received


at first look it seems this may work...

probably OnWindowsCreated() in an AddOn to hook the Control Panel startup .... ??

will post if I get it working

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,665 since Jun 2009
Thanks: 3,786 given, 4,494 received

Why not save a workspace with this AddOn then use this workspace by default?

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
 
(login for full post details)
  #5 (permalink)
Neuquen, Argentina
 
Experience: Intermediate
Platform: Ninja
Trading: CL, TF, 6S, NG, sometimes GC
 
Posts: 200 since Jul 2012
Thanks: 25 given, 42 received

Ok, with some hacking I have it working...it is simple once I could get myself out of the way.... :-)

The task at hand was to load SQL database parameters into public static variables during startup. These then configure my strategies and indicators. In NT7 I had to kludge this, but in NT8 it actually feels like the architecture can accommodate this easily.

I moved the public static variables into a non-ninja namespace/class in CS file in AddOns. The Ninja editor will open it and make changes, save it back just like it was an AddOn.

And, then it is relatively simple....in an AddOn...to load data from SQL tables during the Ninja startup

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
}
else if (State == State.Configure)
{
t1 = new Thread (new ThreadStart (LoadSQLData));
t1.Start();
}
}

I started another thread so that the startup process was not encumbered waiting for the database login, access, etc.

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > How to start background process in NT 8 when Control Panel start?


Last Updated on November 24, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts