![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2009
Location: Los Angeles
Posts: 45
Thanks: 0
Thanked 0 times in 0 posts
|
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...
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
If you lose connection, you can trigger some logic through the OnConnectionStatus() method for how you would like to handle it.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2009
Location: Los Angeles
Posts: 45
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
You will have to just clear out all of your lists and such and wait for it to repopulate.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |