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

NT8 manual -> Beast Practices -> Responding to user events question

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

    NT8 manual -> Beast Practices -> Responding to user events question

    Please, look at screenshot.
    Why methods have different names?
    Is this mistake, or there is some logic behind this?
    Attached Files
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello,

    Thank you for the post.

    In this example, there are Two events being subscribed/unsubscribed (two different objects with the same event type). Generally, each event handler would have its own void method to receive the event arguments when the event happens.

    Because the Event Args are likely different between events and they are not interchangeable each would require the specific void method with the correct overload parameters.

    In this specific example, the EventArgs happen to be the same but it would be best practice to have two separate method bodies so you know what void is executing the code for which mouse down event.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Oh, I'm sorry Jesse, for vague question.

      I mean why
      doCustomWPFControlClickEvent differ form DoCustomWPFControlClickEvent

      and

      doUserClickedChartPanelEvent differ form DoUserClickedChartPanelEvent

      I mean difference in first letter: big and small letter "D".
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello,

        This is likely just the original author of this sample has just left one as a lower case, you can name a Method any way you would like so long as it is a valid name for a method.

        Please let me know if I may be of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by manitshah915, Today, 12:59 PM
        0 responses
        2 views
        0 likes
        Last Post manitshah915  
        Started by ursavent, Today, 12:54 PM
        0 responses
        2 views
        0 likes
        Last Post ursavent  
        Started by Mizzouman1, Today, 07:35 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by RubenCazorla, Today, 09:07 AM
        2 responses
        13 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by i019945nj, 12-14-2023, 06:41 AM
        7 responses
        82 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X