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

Access to TriggerCustomEvent() from within an Add-On

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

    Access to TriggerCustomEvent() from within an Add-On

    I have a System.Timers.Timer implemented in my custom Add-On with an associated TimerEventProcessor() method to handle the timer event. I have verified the timer triggers and activation of TimerEventProcessor() are working correctly in the Add-On. But, the TimerEventProcessor() method is not updating class member variables/objects as needed, so I tried calling TriggerCustomEvent() method from within TimerEventProcessor() to see if that would allow the custom timer event handling code to execute correctly. TriggerCustomEvent() is not recognized by the compiler in the Add-On. Any helpful advice or suggestions for a solution using a Timer event to trigger the periodic update of class member variables/objects in an Add-On or gaining access to the TriggerCustomEvent() method in an Add-On will be greatly appreciated.

    The basic code goes something like this, (which does compile in an indicator. but will not compile in an Add-On):

    private void TimerEventProcessor(Object source, System.Timers.ElapsedEventArgs eventArgs)
    {
    TriggerCustomEvent(myCustomHandler, 0);
    }

    private void myCustomHandler (Object state)
    {
    // update some class member variables
    }


    #2
    Hello pt-emini,

    Thanks for your post.

    The TriggerCustomEvent method is typically for indicators or strategies when a custom event needs to synchronize with the bars series. You should be able to omit the TriggerCustomEvent and just manipulate your class variables in the TimerEventProcessor method.

    Please let me know if this does not resolve your inquiry.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by zstheorist, Today, 07:52 PM
    0 responses
    5 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    6 views
    0 likes
    Last Post tkaboris  
    Working...
    X