Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator to send me an email in realtime

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

    indicator to send me an email in realtime

    I'm kinda having the same issue. I want an indicator to send me an email only when conditions are all met and it's connected to live data. So I did something like this for the logic:
    Code:
    if (emailto.ToString() != null && Time[0] == DateTime.Now)
                {
    However Time[0] is never equal to DateTime.Now even on live data.
    Time: 9/5/2017 9:51:00 AM DateTimeNow: 9/5/2017 9:50:59 AM
    So how can I make sure that I'm sending an alert email on the last bar of realtime data only????
    In NT7, we had a 'historical' method. So I could just do it like this
    Code:
     if(emailto.ToString() != null && !historical)sendmail()
    Thoughts?
    Last edited by gqman; 09-05-2017, 09:05 AM.

    #2
    Hello,

    Thank you for the post.

    I have moved this into a new thread as this seems to be an unrelated question.

    Regarding DateTime.Now, this should not be used in NinjaScript to compare time, this is the PC time which has little relevance to what is being processed in the script.

    If you want to do something once in Realtime, you could just use the State system from OnBarUpdate:

    Code:
    if(State == State.Realtime)
    {
    //do something in realtime
    
    }
    You can locate changes like this in the code breaking changes guide: http://ninjatrader.com/support/helpG...ng_changes.htm

    I look forward to being of further assistance.

    Comment


      #3
      Thanks for the help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X