Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
OnTermination() not called when NT message event occurs
Collapse
X
-
Sure,
please let me know when you have some more information and we will analyze it. Thanks for reporting.
-Brett
-
My indicator adds a few object in OnStartUp() and removes them in OnTermination(). When I hit F5, all works as expected.
However, I'm seeing my objects added twice when an NT error occurs (such as trying to go to an instrument that doesn't exist... that causes that loud error sound). I'm assuming what is happening is that OnTermination() is not called to remove my objects, but OnStartUp is called, thus my objects are added a second time.
I'm trying to nail down the exact situation where my objects are not being removed properly. I'm also looking into just putting in additional checks to make sure, even in this situation, they won't be added twice.
I'll let you know if I can find more information.
Leave a comment:
-
On Termination should be called any time the strategy is terminated.
Are you saying the strategy is getting terminated however On Termination is not being called?
If so can you give me details on how to duplicate this so that I can test on my side.
-Brett
Leave a comment:
-
OnTermination() not called when NT message event occurs
Hello,
I am running into an issue where if there is some kind of NT message event (such as invalid instrument or invalid time frame, etc) then the OnTermination() function is NOT called, but Initialize() is called again. This is causing issues with my indicator since things are not correctly disposed within OnTermination, yet they are re-added during Initialize().
Does my situation make sense?
EDIT: Actually, I think it's OnStartUp() that is called again (rather than Initialize()) and OnTermination() is not.
Thanks!
DanielLast edited by neoikon; 04-19-2012, 02:32 PM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by StrongLikeBull, Yesterday, 04:05 PM
|
1 response
12 views
0 likes
|
Last Post Today, 06:34 AM | ||
Started by Mestor, 03-10-2023, 01:50 AM
|
14 responses
375 views
0 likes
|
Last Post
by z.franck
Today, 06:32 AM
|
||
Started by molecool, 10-09-2017, 10:48 AM
|
5 responses
1,621 views
0 likes
|
Last Post
by trader-ap
Today, 06:29 AM
|
||
Started by The_Sec, Yesterday, 03:53 PM
|
1 response
12 views
0 likes
|
Last Post Today, 06:23 AM | ||
Started by mmenigma, Yesterday, 03:25 PM
|
1 response
11 views
0 likes
|
Last Post Today, 06:09 AM |
Leave a comment: