Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Heartbeat Monitoring

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

    Heartbeat Monitoring

    Hey guys,

    I would like to leave my strategy running on a computer were I do not have to monitor manually.
    So the idea was some heartbeat signal...basically sending a http request to a monitoring website every 15mins or so.
    The problem is that when you activate the strategy it will back load the last 5 or more trading days of data and send out a lot of requests for the past.
    Is there any check I can do before sending the heartbeat to see if the strategy is still in the past...loading old data?

    Thanks
    Florian

    #2
    Use State.Historical or State.Realtime.

    See here.

    Comment


      #3
      great! Easy solution. Thank you!

      Comment


        #4
        Or use a timer, so you can communicate the fact that you haven't had any ticks or bars come in. If you do it in OnBarUpdate, then if there's no data coming in, it does not run. Of course, if the goal is for the external monitor to notice that you have not communicated, that may be enough.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Hello Florian,

          Thanks for your post.

          You could check if State == State.Historical or State.Realtime to check if the current state being processed is Historical or Realtime as bltdavid shared.

          OnStateChange: https://ninjatrader.com/support/help...tatechange.htm

          Or, you could consider implementing a timer in your script like QuantKey_Bruce suggested.

          Here is a help guide page with sample code for implementing a timer: https://ninjatrader.com/support/help...ustomevent.htm
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          93 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          138 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          123 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          73 views
          0 likes
          Last Post PaulMohn  
          Working...
          X