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!
See more
See less

Partner 728x90

Collapse

Implementing a delay after first SendMail execution, possible?

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

    Implementing a delay after first SendMail execution, possible?

    Hi,
    I have implmented SendMail in one of the scripts and it works fine but some time it generates too many e-mail messages in a short period of time. I want to limit the number of e-mails that i can get. So i am thinking of a way where after the first email is sent, system would not send an email for next 30 minutes, just like rearm function of 'Alert' command.

    I'd appreciate If anyother user of NinjaTrader or support staff has any tips about what commands can I use to code such a functionality. Following is my sample script:

    {
    // Condition set 1
    if (EMA(25)[0] > EMA(72)[0])
    {
    // SendMail([email protected], "[email protected]", "Go Long GBP/CHF", "Buy GBP/CHF");
    Log("Buy Alert GBP/CHF", LogLevel.Information);
    }

    Any cues will be helpful.
    Thanks.
    Last edited by Rhoniel; 02-28-2010, 11:33 AM.

    #2
    Hello,

    Try adding a bool flag with a reset function that is determined with time. So you will want to look at ToTime(Time[0]) and compare it to a time your saved at the time of the last alert. These links will help:






    If it a try and post your attempt with questions if you have any.
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    191 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,230 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X