Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer Indicator not displaying alerts/log messages

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

    Market Analyzer Indicator not displaying alerts/log messages

    I have an indicator I coded and running in Market Analyzer that should be generating alerts at various levels (Priority.Low, Medium, High) based upon a value the indicator generates, bit I do not see any alerts being generated. I do see the indicator value that is generated being displayed in MA.

    Additionally, I added logging to my code and do not see any logging messages being generated. I even added a log message as the first line of code in the OnBarUpdate() method and still nothing.

    To force my indicator to run for each symbol in MA, I do F5 (Reload NinjaScript) in the MA window.

    Any ideas what may be happening here?

    thx for any assistance!!

    #2
    Also, reading another post with Alerts issues, I do have Alerts turned on in the MA window. Not sure if it's needed if you are generating alerts from ninjascript or not but made sure it was on regardless.

    Comment


      #3
      Are you loading up enough bars for your indicator calcs to trigger in the MA? Would you see a different Alert / Log behavior when running the same script from a chart for testing?

      BertrandNinjaTrader Customer Service

      Comment


        #4
        Yes, I changed the default bars to look back from 50 to 200 and it made no difference. I also took your advice and dropped the indicator onto a 60min chart and I see it plotting correctly but no log/alerts.

        I've attached a screenshot showing the indicator in the chart + MA. I circled the column in MA with my indicators so you can see it's generating values + I circled a specific one with a value of 4.23 which should have generated an alert/log.

        what I don't understand is I put a logging line in the code as the first line in the OnBarUpdate method. This should definitely be generating a log message for each symbol in the MA correct?
        Attached Files
        Last edited by jeddah62; 07-14-2011, 08:31 AM.

        Comment


          #5
          Thanks for the reply - when you say 'logging', do you mean a Log entry or a Print to the output window?

          I also see you running oftentimes in IB's data limitations, so perhaps it would good to disconnect from IB, wait for about 10 mins and then reconnecting / retesting fresh with the lookback being high enough so all data could be for sure loaded as needed.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            A log message that Generates log output to the NinjaTrader Control Center window Log tab.

            I am now even doing a Print that should go to the output window.

            Nothing seems to be working.

            I put all 3 (alert, log, print) into a simple indicator that prints a blue arrow under a given condition. I did this so you can see on your chart the blue arrow which when printed should have generated a log, print and alert.

            I'm sure there is something simple I'm not doing now under NT 7, but I know alert and print used to work under 6.5.

            I've attached the indicator for you to see the simple code + try on your system to verify it works.

            -thx!
            Attached Files

            Comment


              #7
              Hi jeddah62,

              I applied your indicator to a chart and I'm seeing output, log messages and blue arrows. Alerts only show up when triggered in real time so not expecting them.

              Next step for real time debugging is printing all related values in your condition. As you are checking for Rising conditions, print the current [0] and previous [1] index value when used. Use the following few lines at the top of OnBarUpdate() and then check for output.

              if (CurrentBar < Period) return;

              Print("CurrentSMA: " + SMA(Period)[0]);
              Print(" PrevSMA: " + SMA(Period)[1]);
              Print(" Close: " + Close[0]);
              Print(" Open: " + Open[0]);

              Additional help for debugging in NinjaTrader is available here:


              It shouldn't be contributing to an issue here, but best practice is using the upper-case public property in code, rather than the lower case - Use Period in code rather than period.
              Last edited by NinjaTrader_RyanM1; 07-17-2011, 09:49 PM.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Ryan,

                I implemented the code you posted along with my printing of the Blue up arrow which I see the up arrows but no print. I'm not quite sure of the purpose of this last effort as the issue I'm having is with the Print, Log and Alerts and this code snippet uses Print().

                If my indicator I posted worked for you then this really indicates a real issue with my version of NT. I'm at a loss as to how to proceed with this. Any idea what the Print() method actually does in the compiled code. Does it Queue it, write it to a database, directly to a file?

                It just seems that any I/O that my NT tries to do to seperate windows (Output, Alert, Log) just does not work. How do these windows communicate with each other?

                thx - brian

                Comment


                  #9
                  Print sends output to Tools > Output window. If you never opened an output window before, then you could not check that Print() is working properly. It's a simple action you can use to verify both that a code block has executed, as well as to check values used in your condition.

                  The print statements I put in are designed to check the values used in your condition, so you should be able to see output related to these values. They're placed outside the condition so should trigger with each OnBarUpdate(). You will only see the Alert() component when the condition is true in real time.

                  I wouldn't worry yet about your NT installation. If you are new to custom script development, you may want to simplify a bit the conditions you're checking for just so you can see output and verify the script is working. It's useful to first get the mechanics down with simple examples before adding unnecessary complexity.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    I think all these issue stem from an issue with Custom Indicators.

                    I noticed when I modified my simple blue arrow indicator to remove the blue arrow, it compiled just fine, but the chart still had the blue arrow. this told me something was funky with my indicators.

                    I restarted NT and now for some reason now, all my indicators I've imported over the last year are not in the indicator list when I try to add a new indicator.

                    additionally, when I try to import and Indicator, I get an error dialogue show in the screen shot. I have no idea which indicator is causing this issue. I looked in NT trace.txt and log files and I don't see anything.
                    Attached Files

                    Comment


                      #11
                      Yes, first step before evaluating indicator functionality is verifying that your NinjaScript files can be compiled successfully. When creating any new indicator, compiling is 100% required before using it.


                      Please follow the instructions below to see where the errors are coming from after compiling the indicator. This will allow you to debug the indicator/strategy or remove it from your PC. If you are wondering why you receive an error when compiling only one indicator, it is because NinjaTrader compiles all indicators and strategies- not just one.

                      * Open NinjaTrader
                      * From the Control Center select the Tools menu--> select the Edit NinjaScript menu item--> select Indicator
                      * Select an indicator and double click on it.
                      * A new window will appear and you will need to right click in the window and select Compile to compile the indicators.
                      * At the bottom of the window a new section will appear were you can find the error locations.
                      * From there you have the option to remove the indicator or debug it.

                      Let me know if this does the trick for you.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        ok, everything seems to be working. There was a compile time error in an indicator from eons ago that was keeping the custom indicator dll from building correctly. that was really strange. Fixed error and now seeing all output. will see if alerts are generated tomorrow during market hours.

                        thx for all your assistance!! very much appreciated.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by GLFX005, Today, 03:23 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post GLFX005
                        by GLFX005
                         
                        Started by XXtrader, Yesterday, 11:30 PM
                        2 responses
                        11 views
                        0 likes
                        Last Post XXtrader  
                        Started by Waxavi, Today, 02:10 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post Waxavi
                        by Waxavi
                         
                        Started by TradeForge, Today, 02:09 AM
                        0 responses
                        14 views
                        0 likes
                        Last Post TradeForge  
                        Started by Waxavi, Today, 02:00 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Waxavi
                        by Waxavi
                         
                        Working...
                        X