Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compiler failed to detect error

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

    Compiler failed to detect error

    I entered the following code in State==Configure place in my Custom indicator script.

    if( BarsPeriod.BarsPeriodType == BarsPeriodType.Day ||
    BarsPeriod.BarsPeriodType == BarsPeriodType.Week ||
    ( BarsPeriod.BarsPeriodType == BarsPeriodType.Minute &&BarsPeriod.Value>30 ) )
    {
    IsTradingHoursBreakLineVisible = false;
    }
    else
    {
    IsTradingHoursBreakLineVisible = true;
    }

    When I compiled it there were not compile errors or warnings.

    The problem is that my script file's name did not appear in the list of available indicators. Apparently, the compiler failed to notify me of what it thought was an error.

    I originally put this code segment in the State=Default because the help file states Caution: IsTradingHoursBreakLineVisible can only be set in the State=Default or State=Configure.

    I moved the code segment to State=Configure and the compiler had no error and my Indicators script name appeared in available list as it should have.

    #2
    Warning: This property should NOT be accessed within the OnStateChange() method before the State has reached State.DataLoaded
    Source.....

    Comment


      #3
      seefisch,

      The reason you weren't getting an error in the compiler is because your code is logically correct so it compiled successfully. However, the indicator didn't initialize correctly. That's why it wasn't on the indicator list. You can see that error in the log tab of your Control Center.
      Bobby Y.NinjaTrader Customer Service

      Comment


        #4
        Quote from NT8 help file 8.0.0.7 Beta

        When I searched the Help file for "IsTradingHoursBreakLineVisible" I got the following quote

        Property Value
        This property returns true if trading hours break lines are plotted on the indicator panel; otherwise, false. Default set to true.

        Warning: This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure


        Syntax
        IsTradingHoursBreakLineVisible

        I guess You have a different Help file then I do.

        Comment


          #5
          OMG is that ever going to be hard on us developers. I won't be able to put into the script file Print() statements to find where it crashed. I'll learn how to work with it, but my first impression is this is going be hard to live with.
          Last edited by seefisch; 12-23-2015, 12:35 PM. Reason: More thoughts

          Comment


            #6
            seefish,

            Just to clear things up, there is only 1 NinjaTrader 8 Help Guide: http://ninjatrader.com/support/helpGuides/nt8/en-us/

            I think there was a miscommunication between you and quicktrick. quicktrick was pointing out that you cannot use BarsPeriod within the Confifgure state. And as you found in the help guide, you can only use IsTradingHoursBreakLineVisible in the SetDefault or the Configure state.

            You can learn more about OnStateChange() here: http://ninjatrader.com/support/helpG...tatechange.htm

            Hope that clears things up.
            Bobby Y.NinjaTrader Customer Service

            Comment


              #7
              IsTradingHoursBreakLineVisible did NOT work in SetDefault

              Not wanting to drag this out any longer but, that was my original reason for posting. The help file says I CAN set TradingHoursBreakLineVisible in SetDefault but it did not work for me. When I moved it to Configure it worked fine. Either the help file is wrong or there is a bug. Try it for yourself.
              Last edited by seefisch; 01-02-2016, 04:34 PM.

              Comment


                #8
                seefisch,

                To assist you better I'll need to take a look at your indicator and test it out on our end. You can either attach the indicator to the thread or you can send an email to platformsupport[AT]ninjatrader[DOT]com with it attached.

                You can export the indicator by going to Tools > Export > NinjaScript. Then you'll need to add the indicator to export by clicking the "add" button and select the indicator and click "OK". Then click on the newly added Indicator in the "Export NinjaScript" window, then click "OK".
                Bobby Y.NinjaTrader Customer Service

                Comment


                  #9
                  I sent you the script file

                  You were unable to duplicate my observations

                  My indicator wroks fine.

                  I never know how much time to spend tracing things like this out. Hopefully I don't have unexpected problems as I further develop my script. I put it on my list of things to look into.
                  Last edited by seefisch; 01-02-2016, 04:32 PM.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by mattbsea, Today, 05:44 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post mattbsea  
                  Started by RideMe, 04-07-2024, 04:54 PM
                  6 responses
                  31 views
                  0 likes
                  Last Post RideMe
                  by RideMe
                   
                  Started by tkaboris, Today, 05:13 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post tkaboris  
                  Started by GussJ, 03-04-2020, 03:11 PM
                  16 responses
                  3,282 views
                  0 likes
                  Last Post Leafcutter  
                  Started by WHICKED, Today, 12:45 PM
                  2 responses
                  20 views
                  0 likes
                  Last Post WHICKED
                  by WHICKED
                   
                  Working...
                  X