Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Duplicate Trades

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

    #16
    Still not there. I want to know how to monitor the log IN CODE.
    Thanks ... Ed

    Comment


      #17
      Hello edstafin,

      I appreciate your patience, I am going to need to ask some clarifying questions and illustrate my thinking.

      I'm unsure what is meant by in the code. There is no already built-in event that gets fired during logging such as OnLog. Implementing a custom event should not prove difficult. We have documentation which should help here,



      Microsoft also publishes publicly available documentation should your needs surpass what Ninja can support out of the box,



      Even without custom events, however, every point in the code where you would call Log, for example during OnBarUpdate, you are able to call methods such as SendMail. I would advice "decorating" the Log method with a wrapper which also calls SendMail, and performs any other additional functionality you desire, such as

      Code:
      private static void MyLog(string message)
      {
          Log(LogLevel.Alert, message);
          SendMail("[email protected]", "My NinjaScript Subject Line", message);
      }
      For a list of all the events that Ninja has out-of-the-box, I prefer using the Alphabetical reference page, turned to the letter O for "On", http://ninjatrader.com/support/helpG...eference.htm#O

      I am happy to clarify any of the above, and deeply appreciate any further explanation, as we work together to resolve your query.
      Jessica P.NinjaTrader Customer Service

      Comment


        #18
        Ok, let me try and clarify. The events logged that I originally uploaded a screenshot of were not entries I made. They were generated by NT.
        I would like to be able to catch an event that is generated by NT any time anything is logged so I can inspect the contents of logged message and make decisions on what to do. For example, if there is some "price connection" error I want to disable my strat and send an email to myself. I am not looking to trigger an event (custom or otherwise) but rather consume one. There does not appear to be a OnLoggedEvent published. I am going to assume that the log data is stored in the .sdf file and that if I need to I can write some sort of trigger that when and entry is made into the log do ...whatever ... I will go down that rabbit hole only as a last resort.
        Thanks ... Ed

        Comment


          #19
          Hello Ed,


          I have submitted a feature request to the product management team for the following feature :

          This user would like a new overrideable event handler such as "protected override void OnLogMessage(string message, LogLevel loglevel)" which is triggered whenever the log or trace files are written to, either by Ninja or a user generated event


          I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.


          Please let us know if there are any other ways we can help.
          Jessica P.NinjaTrader Customer Service

          Comment


            #20
            Thanks!
            Sorry for all the miscommunication!
            Ed

            Comment


              #21
              Not at all, thank you for both your patience, and for helping to make NinjaTrader 8 better.
              Jessica P.NinjaTrader Customer Service

              Comment


                #22
                Hello Ed,

                I have started a conversation with the responsible teams. I would like to pass some of the results of that conversation with you, since some of them may be immediately useful.

                While every feature is considered, features are usually added more quickly when many members of the community express an interest and vote for the same feature. In the meantime, there may be an immediate resolution to your query. I would to ask if you have considered using the OnConnectionStatusUpdate event, documented here



                This approach may be superior, as it exposes actual documented C# objects, instead of messages you would have to turn back into objects if you wanted to do further processing, which themselves may not have all the contextual information you desire.

                Second, while this is undocumented and we can only provide limited support, there is a LogEvent class under Cbi.Log that you may desire to investigate. This is also immediately available to you.


                Please let us know if there are any questions we may answer.
                Jessica P.NinjaTrader Customer Service

                Comment


                  #23
                  Thanks! I'll dig in and get back to you asap.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by claxxical, 05-30-2017, 12:30 PM
                  37 responses
                  4,453 views
                  0 likes
                  Last Post Padan
                  by Padan
                   
                  Started by SugarDefwebsite, Today, 02:18 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post SugarDefwebsite  
                  Started by usglucofreeze, Today, 01:19 AM
                  0 responses
                  7 views
                  0 likes
                  Last Post usglucofreeze  
                  Started by f.saeidi, Today, 01:12 AM
                  0 responses
                  14 views
                  0 likes
                  Last Post f.saeidi  
                  Started by NinjaTrader_ChelseaB, 03-14-2017, 10:17 AM
                  227 responses
                  34,319 views
                  7 likes
                  Last Post rare312
                  by rare312
                   
                  Working...
                  X