Announcement

Collapse
No announcement yet.

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?

    https://ninjatrader.com/support/help...ustomevent.htm

    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 minds2010, Today, 03:38 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by DTSSTS, Yesterday, 07:11 PM
        2 responses
        32 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by ntbone, Yesterday, 11:42 PM
        2 responses
        18 views
        0 likes
        Last Post ntbone
        by ntbone
         
        Started by mr_trade, 11-26-2020, 05:01 PM
        5 responses
        59 views
        0 likes
        Last Post mr_trade  
        Started by evanp90, 01-14-2021, 07:03 PM
        4 responses
        33 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X