Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Print

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

    Problem Print

    hi, see that structure of my code :

    Code:
    namespace NinjaTrader.NinjaScript.Indicators
    {
    
         public class MT
        {
        if (MT.refIndicator != null)
                {...
                 ...<code>
                    MT.refIndicator.Print("bla bla.. ");
           }
        }
    
     public static MainTrendAnalisys refIndicator;
    
         public MT(MainTrendAnalisys main)
            {
                refIndicator = main;
            }
     
     public class MainTrendAnalisys : Indicator
        {
      public MT Mt;
    .....
    
         }
    my code is confused..ok...but when i try to print in other class..i always to get error ...

    It correct my script?

    (i use the reference print from the main class that inherits from indicator)



    or i must to execute Debug to find error
    Last edited by esignal; 08-23-2016, 06:37 AM.

    #2
    Hello esignal,

    While I understand you are providing a truncated code sample, please understand that when we have blocks such as

    Code:
    [FONT=Courier New]     public class MT
        {
        [B]if (MT.refIndicator != null)
                {[/B][/FONT]
    With the bolded logic outside of a method, it makes it difficult to advise. It could be that the logic is truly outside of a method, which would cause your code to not compile, and this would be the answer to your question.

    However, if this compiles, then this means that I must assume that your if statement is in fact inside a method. This means that our shorthand is excluding vital information I would need to resolve your query, as your method signature is needed to understand what symbols such as "refIndicator" are referring to.

    Therefore I would like to ask if you could attach a C# file from your (My) Documents\NinjaTrader 8\bin\Custom\Indicators folder which compiles successfully? It will be easier to answer your question with this file. If you have any proprietary code, please strip it out before attaching it, or e-mail it to platformsupport[at]ninjatrader[dot]com referencing this unique ID : 1561207 . Please also include "Attn: NinjaTrader_JessicaP" in with the body or subject of this e-mail.

    Thanks in advance, having this information available will make it easier to give you better service.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      refindicator is a reference to my indicator(i do this to use print)
      Last edited by esignal; 08-23-2016, 07:20 AM.

      Comment


        #4
        Thank you for this added information. I would like to ask, do you see any error messages in your script editor window, or in the logs tab of your control center?
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          No... no message.....
          It's all ok..

          the compile is ok!....the log file i don't see message error of this problem..

          if i use so long history....The indicator to go in error....

          Sometimes is run correctly...

          Comment


            #6
            Thank you for this additional information.

            You mentioned in your original post that you can reliably always get an error to come up when you try to print in another class. Can I ask you to do this and send us the error you get?
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              eh...is not a error ..

              it 's

              Comment


                #8


                It can help?

                Comment


                  #9
                  Thank you esignal, this helps us a great deal.

                  Please follow these steps to retrieve the reason NinjaTrader has most recently crashed from your Event Viewer



                  First, please open up your Control Panel. The Search box is in the upper right hand side. Please type "view event logs" into this box.



                  Next, please click "View event logs" on the left



                  Next, on the left side, drill down to Windows Logs -> Application. In the center, page down in the table (4) until you see "The program NinjaTrader.exe" in the lower box (5) . Once you see this, click the "Details" tab (6)



                  Once here, please select the XML View radio button (7) . In the XML View (8), click in this window, press ctrl + a, observe all the text is now highlighted as it is in the picture, and press ctrl + c . Open up your favorite text editor (9) and press ctrl + v inside it. Observe the text is now inside your text editor. Save this file (10) as EventViewerLog.xml (11)

                  You can download larger versions of each image below.
                  Attached Files
                  Last edited by NinjaTrader_JessicaP; 08-23-2016, 10:37 AM.
                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    Code:
                    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
                    - <System>
                      <Provider Name="Application Error" /> 
                      <EventID Qualifiers="0">1000</EventID> 
                      <Level>2</Level> 
                      <Task>100</Task> 
                      <Keywords>0x80000000000000</Keywords> 
                      <TimeCreated SystemTime="2016-08-23T16:36:56.534677400Z" /> 
                      <EventRecordID>9912</EventRecordID> 
                      <Channel>Application</Channel> 
                      <Computer>Luca-PC</Computer> 
                      <Security /> 
                      </System>
                    - <EventData>
                      <Data>NinjaTrader.exe</Data> 
                      <Data>8.0.0.12</Data> 
                      <Data>577d3093</Data> 
                      <Data>KERNELBASE.dll</Data> 
                      <Data>10.0.10586.494</Data> 
                      <Data>5775e4c5</Data> 
                      <Data>80000003</Data> 
                      <Data>00000000000c2d52</Data> 
                      <Data>4140</Data> 
                      <Data>01d1fd5b5d55260e</Data> 
                      <Data>D:\NinjaTrader 8\bin64\NinjaTrader.exe</Data> 
                      <Data>C:\WINDOWS\system32\KERNELBASE.dll</Data> 
                      <Data>25f32442-a01d-4fad-89b2-b8557fbc7f94</Data> 
                      <Data /> 
                      <Data /> 
                      </EventData>
                      </Event>
                    this is log file

                    Comment


                      #11
                      i 've try other examples and about me the problem is Print ..

                      Is possible?

                      In the main Indicator ...i've write :


                      if (str1 == null) Print("str1 e' null");
                      if (str1!= null) Print("sono in segnale " +str1);
                      Ok...if i load 10 days frame 1 minute is ok..
                      if i load 500 days frame 1 min ....i see it :

                      Comment


                        #12
                        Thank you for providing this output, and for the added explanation.

                        Are these good steps I can attempt to reproduce this on my end?

                        • Create 1 indicator which contains a Print() method inside a public method, such as

                          Code:
                          [FONT=Courier New]
                          public void printFromOutside(string message)
                          {
                              Print(message == null ? "null" : message);
                          }[/FONT]
                        • Create another indicator which uses this method in OnBarUpdate
                        • Run this indicator in a 1 tick chart with 500 days data going back

                        If this is the case, I will attempt to reproduce this on my end, and I can get back to you with my findings.
                        Jessica P.NinjaTrader Customer Service

                        Comment


                          #13
                          Okk...

                          i did you examples...

                          i attached file .zip (with 2 indicator.....see it if it's correct)...

                          the ninjatrader stopped (see pics below)...(i put chart 500 days with 1 tick)

                          Attached Files
                          Last edited by esignal; 08-23-2016, 01:34 PM.

                          Comment


                            #14
                            NinjaTrader stopping is a good thing if your prova2 indicator caused this, it means that we are one step closer to determining what was happening.

                            However, I could not get it to crash on my computer. It ran successfully with 1 tick data over 500 days.

                            It looks like I am missing just one more piece of the puzzle on my end. Can you open up your System control panel and send a screen shot?

                            To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.
                            Click here for instructions
                            Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
                            Click here for detailed instruction



                            Once I know what kind of a system you have I can emulate it on my end.
                            Jessica P.NinjaTrader Customer Service

                            Comment


                              #15
                              i use chart 50 days ..1 minute frame


                              see pics
                              Attached Files
                              Last edited by esignal; 08-23-2016, 02:21 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aussugardefender, Today, 01:07 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post aussugardefender  
                              Started by pvincent, 06-23-2022, 12:53 PM
                              14 responses
                              238 views
                              0 likes
                              Last Post Nyman
                              by Nyman
                               
                              Started by TraderG23, 12-08-2023, 07:56 AM
                              9 responses
                              384 views
                              1 like
                              Last Post Gavini
                              by Gavini
                               
                              Started by oviejo, Today, 12:28 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post oviejo
                              by oviejo
                               
                              Started by pechtri, 06-22-2023, 02:31 AM
                              10 responses
                              125 views
                              0 likes
                              Last Post Leeroy_Jenkins  
                              Working...
                              X