• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 Teebone21, Today, 10:38 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by futurestrader7, Today, 11:31 AM
    0 responses
    3 views
    0 likes
    Last Post futurestrader7  
    Started by J_o_s, 03-30-2020, 12:29 AM
    2 responses
    16 views
    0 likes
    Last Post J_o_s
    by J_o_s
     
    Started by ptpatrader, Today, 10:27 AM
    0 responses
    6 views
    0 likes
    Last Post ptpatrader  
    Started by albertokeira, Today, 09:30 AM
    0 responses
    8 views
    0 likes
    Last Post albertokeira  
    Working...
    X