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 NullPointStrategies, Today, 05:17 AM
          0 responses
          44 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          65 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X