Announcement

Collapse
No announcement yet.

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:

    http://www.ninjatrader-support.com/H...V6/ToTime.html

    http://www.ninjatrader-support2.com/...ad.php?t=19292


    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 fredrikn, 05-08-2019, 04:01 AM
    57 responses
    4,391 views
    2 likes
    Last Post Momentum  
    Started by Blairski, Yesterday, 09:19 AM
    2 responses
    11 views
    0 likes
    Last Post Blairski  
    Started by tonynt, Today, 09:33 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by minotti1, Today, 08:31 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by SmartArtsStudio, 05-15-2021, 10:46 AM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X