Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Generate periodic custom event during HISTORICAL state

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

    Generate periodic custom event during HISTORICAL state

    How to trigger an event that fires once per second during State.Historical, regardless of whether my primary or secondary one tick data series has a BarUpdate event?
    Analogous to a timer, but timer only works in real time. Thank you!

    #2
    Hello Ricam,

    Thanks for your post.

    We have received your inquiry and are currently looking into this matter.

    After we are finished investigating this inquiry we will update this forum thread.

    Thanks for your patience.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Ricam,

      Thanks for your patience.

      After researching this matter we have found that this would not be possible to accomplish using a timer and we do not have any NinjaScript methods or properties available to accomplish this.

      You would need to have data at those intervals that the custom event is being triggered and State.Historical is run all at once.

      This forum thread will be open for other community members to share their insights on the topic.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        One drawback of this is that in slow markets there will be missing ticks in time based data. Not sure that this causes any actual problems.

        Comment


          #5
          Add another data series of bar type "1 second" and then use BarsInProgress == that to determine if 1 second has gone by? That would work except when there are no ticks at all during the second (and thus, no updates on ANY of your data series for that instrument) - since Historical blasts by as fast as possible and not in realtime, you would need to examine on the next update if it has been "too long" and then simulate that you got the 1-second event one or more times if, for instance, two adjacent ticks are an hour apart. If you do not care about simulating historical 1-second events when there are no trades, then you can skip this part entirely.
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,406 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          98 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          8 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          160 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          9 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X