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

how to get event just once on specific time

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

    how to get event just once on specific time

    Hello,

    My requirement is for NinjaTrader to be notified precisely at certain time.

    Will TriggerCustomEvent with timer (as shows in samples) be precise enough? Or are there a better ways to accomplish it?



    From what I've read - best way is to accomplish it through task scheduler. But I would like to have it as a parameter in my strategy but to be 100% sure that it would get triggered at specific second.

    Do you have any best practices samples on how to accomplish it?

    Thanks a lot!

    #2
    Hello music_p13,

    Thanks for opening the thread.

    OnBarUpdate() will iterate with each incoming tick, and there is no guarantee that it will be iterated at a specific moment if no data is coming in. In that case, it would be worthwhile to add your own timer for your own time based events.

    We do have an example that shows how you can add a timer to a NinjaScript, I will provide a link below.

    SampleCustomEvents - https://ninjatrader.com/support/foru...ead.php?t=5965

    If you have any additional questions, please don't hesitate to write back.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim,

      Are there any other more precise ways to trigger certain event at specific time? If for example, I start that timer early in the morning and I want it to be triggered late in the afternoon - is there guarantee that it will get triggered on precise second providing strategy of course is running continuously or can it be off be a few seconds by that time?

      Thanks

      Comment


        #4
        Hello music_p13,

        NinjaTrader only offers market data driven events and does not offer a built in time based event. A timer of your own would have to be added to accomplish this. Since the timer is external to market data events, it is guaranteed to be as precise as you configure it.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by martin70, 03-24-2023, 04:58 AM
        15 responses
        114 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by The_Sec, Today, 02:29 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by jeronymite, 04-12-2024, 04:26 PM
        2 responses
        31 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Mindset, 05-06-2023, 09:03 PM
        10 responses
        265 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by michi08, 10-05-2018, 09:31 AM
        5 responses
        743 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X