Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sending an email on strategy end

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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.





    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X