How should I do this in order to email myself a notification if the strategy has ended, due to error or anything else? Is there a simple solution that can utilize the shareservice feature?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Sending an email on strategy end
Collapse
X
-
Sending an email on strategy end
I've tried to set this up such that on state terminated, I send myself an email - but it sends way too many.
How should I do this in order to email myself a notification if the strategy has ended, due to error or anything else? Is there a simple solution that can utilize the shareservice feature?Tags: None
-
Hello Skifree,
State.Terminated is called for many different reasons in a strategies lifecycle. To know the terminated state only when the strategy has ended you would need to use a variable to know the strategy was started. You can read about the lifecycle of a script here: https://ninjatrader.com/support/help...fecycle_of.htm
You can see the sample on that page that starts with //custom flag to help time termination logic. That would be the same process you would need to do in order to catch only the last terminated after the strategy was active. In State.Historical set the bool to true to know the strategy was running and then check for that in State.Terminated.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
77 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment