Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mail overloaded

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

    Mail overloaded

    Hi, I have a strategy that sends email to me every 5 minutes with buy/sell signals. It worked out perfectly before. Today I turned on that strategy again, and it starts to go crazy on me.

    The strategy all of sudden start sending out email from historical data. As a result, it rapid fires tons of emails starting from whenever the date begins on my chart until it catches up to the current date.

    Is there any internal coding changed in NT's release that causes this problem? Please advise.

    #2
    Hello thecheat,

    Thank you for your post.

    There have not been any recent changes that would change the way SendMail() functions.

    Have you made any recent changes to your code? Would you be able to provide me with a snippet of the condition that is sending these emails?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi, I can't post all the logic and math of the code because it's too long. However, in essence I have the following logic for sending out mails.

      protected override void Initialize()
      {

      Enabled = true;
      ExitOnClose = true;
      SyncAccountPosition = true;
      CalculateOnBarClose = true;
      ...........
      }

      protected override void OnBarUpdate()
      {
      if (BarsInProgress == 0)
      {
      // Some math calculation go to here

      SendMail("[email protected]","[email protected]", BarsArray[0].Instrument.FullName + " Analysis:" + testReportFive + " (Signal Strength: " + (firstInstFiveFinalBuyRat + firstInstFiveFinalSellRat) + "%)", report);


      }

      I suspect that this is more have to do with the settings rather than the coding because the coding hasn't been changed since the last time I turned the strategy on and also because the nature of how the emails are based on historical data rather than real time data. Thanks.
      Last edited by thecheat; 07-20-2011, 08:09 AM.

      Comment


        #4
        thecheat,

        Thanks for providing me with this information.

        The SendMail() function should only work on real-time data. Are you able to reproduce this issue or was it only this morning you've experienced issues? We will need a reproducible scenario to look into this further.

        In addition, I would suggest adding historical checks to your statements to help prevent this from occurring in the future.

        Code:
        if (Historical) return;
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thank you Matthew, I will give it a shot tonight

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by terofs, Yesterday, 04:18 PM
          1 response
          22 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by CommonWhale, Today, 09:55 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by Gerik, Today, 09:40 AM
          2 responses
          7 views
          0 likes
          Last Post Gerik
          by Gerik
           
          Started by RookieTrader, Today, 09:37 AM
          2 responses
          13 views
          0 likes
          Last Post RookieTrader  
          Started by alifarahani, Today, 09:40 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X