NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-03-2009, 08:59 AM   #1
edsfreedom
Member
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 45
Thanks: 0
Thanked 0 times in 0 posts
Default how to reinitialize indicator due to connection lost?

Do anyone know how to reinitialize indicator when connection lost, or to resynchronize it? I have a problem with List. During connection lost, the Removes are missed so that there are phantom Inserts hanging around...
edsfreedom is offline  
Reply With Quote
Old 06-03-2009, 09:04 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

If you lose connection, you can trigger some logic through the OnConnectionStatus() method for how you would like to handle it.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-04-2009, 08:41 AM   #3
edsfreedom
Member
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 45
Thanks: 0
Thanked 0 times in 0 posts
Default

thanks Josh, but I couldn't figure out the other half, which is how do I reinitialize the indicator similar to the behavior as when a new chart opens, or when the indicator is removed then added back.

I'm working with OnMarketDepth, and trying to reset all the List askRows and bidRows, because during connection loss, or change of market replay timing position, the insertions and removals get out of sync, and therefore leaves phantom price/positions around that cannot be removed.

I've tried using List::Clear, reinitializing List = new List, calling Initialize(), but all of them do not mimic the behavior of an actual indicator initialization, because after some of my actions, it takes awhile for the market depth ladder to repopulate, but when opening a new chart, the indicator always repopulate all of it's market depth instantly.
edsfreedom is offline  
Reply With Quote
Old 06-04-2009, 08:45 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

You will have to just clear out all of your lists and such and wait for it to repopulate.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection lost jriverac Automated Trading 5 02-25-2009 09:59 AM
Uable to connect due to internet connection or parametres???? magisana Connecting 1 01-07-2009 02:49 AM
Connection Lost Alert - Play Continuously Until Connection Gained geoMEAN Suggestions And Feedback 1 04-25-2008 02:47 PM
Connection Lost Edgar V. Connecting 5 03-04-2008 09:28 AM
Lost connection lost orders Bogan7 Connecting 1 09-12-2007 11:21 PM


All times are GMT -6. The time now is 08:31 PM.