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

Draw.Ellipse problem with 8.0.6 version

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

    Draw.Ellipse problem with 8.0.6 version

    Has something changed with version 8.0.6 relating to Draw.Ellipse method.
    Was working fine before.
    I get the following error message. : On Render method Index was out of range.
    Must be non-negative and less than the size of the collection.
    Parameter name: index

    Stack :

    Stack : at System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n
    (ExceptionArgument argument, ExceptionResource resource)
    at NinjaTrader.Data.BarsSeries.GetTime(Int32 index)
    at NinjaTrader.Data.BarsSeries.GetSessionEndTime(Int3 2 index)
    at NinjaTrader.Data.Bars.GetSessionEndTime(Int32 index)
    at NinjaTrader.NinjaScript.TimeSeries.get_Item(Int32 barsAgo)
    at NinjaTrader.NinjaScript.DrawingTools.DrawingTool.C reateChartAnchor(NinjaScriptBase
    ownerNinjaScript, Int32 barsAgo, DateTime time, Double y)
    at NinjaTrader.NinjaScript.DrawingTools.Draw.ShapeCor e[T](NinjaScriptBase owner, Boolean
    isAutoScale, String tag, Int32 startBarsAgo, Int32 endBarsAgo, DateTime startTime, DateTime endTime,
    Double startY, Double endY, Brush brush, Brush areaBrush, Int32 areaOpacity, Boolean isGlobal,
    String templateName)
    at NinjaTrader.NinjaScript.DrawingTools.Draw.Ellipse( NinjaScriptBase owner, String tag, Boolean
    isAutoScale, Int32 startBarsAgo, Double startY, Int32 endBarsAgo, Double endY, Brush brush, Brush
    areaBrush, Int32 areaOpacity)

    #2
    NT8 version 8.0.6 problem

    I also get the following error from the log window :


    2017-04-20 08:14:13:221|3|4|Required key "ChartTrader.ActionButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "ChartTrader.SellButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "ChartTrader.BuyButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "ChartTrader.ButtonBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "SuperDom.SellButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "SuperDom.BuyButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "SuperDom.ButtonBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "SuperDom.ActionButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "OrderTicket.ButtonBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "OrderTicket.BuyButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "OrderTicket.SellButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "BasicEntry.SellButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "BasicEntry.ActionButtonsBackground" is missing.
    2017-04-20 08:14:13:222|3|4|Required key "BasicEntry.BuyButtonsBackground" is missing.
    2017-04-20 08:14:13:223|3|4|Required key "FxPro.BuyButtonsBackground" is missing.
    2017-04-20 08:14:13:223|3|4|Required key "FxPro.SellButtonsBackground" is missing.
    2017-04-20 08:14:13:223|3|4|Required key "FxPro.ActionButtonsBackground" is missing.

    Comment


      #3
      Hello blar58, and thank you for your report. I was unable to see quite the same thing on my end with the attached test indicator. Could you try, inside an empty workspace, running this indicator on a chart? If you are unable to make this behavior happen again, could you change the test script I sent your way so it causes the same log and output messages? Thank you for helping to improve NinjaTrader 8.
      Attached Files
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by blar58 View Post
        I also get the following error from the log window :
        2017-04-20 08:14:13:221|3|4|Required key "ChartTrader.ActionButtonsBackground" is missing.
        2017-04-20 08:14:13:222|3|4|Required key "SuperDom.SellButtonsBackground" is missing.
        2017-04-20 08:14:13:222|3|4|Required key "OrderTicket.ButtonBackground" is missing.
        2017-04-20 08:14:13:222|3|4|Required key "BasicEntry.SellButtonsBackground" is missing.
        2017-04-20 08:14:13:223|3|4|Required key "FxPro.BuyButtonsBackground" is missing.
        This is most likely caused by a custom skin. I ran into the same problem, which I fixed by copying the relevant .xaml files from templates\Skins\Slate Gray to my custom skin folder:
        ChartControl.xaml
        BasicEntry.xaml
        FxPro.xaml
        OrderTicket.xaml
        SuperDom.xaml

        If you have modified any of those in your customization, you will need to merge your code.

        Comment


          #5
          Many Thanks tradesmart
          It solved the problem related to Required Key is missing !
          I was using a custom skin ...

          Still working on my Draw.Ellipse problem

          Thanks

          Comment


            #6
            I am glad tradesmart's advice resolved your second query. If you are able to run the test I suggested in post 3 this will make it easier to give the best assistance possible. If you are not please let us know so we can find a different way to help.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              blar58,

              In your original post (#1) in this post (Draw.Ellipse problem with 8.0.6 version), you referred to the Stack as part of your debugging. How / where do you view the stack?

              Apologies, I do not wish to hijack your forum post.

              Thanks
              Shannon

              Comment


                #8
                Shansen

                I print the stack from the try catch.
                In the catch I print the error message e.Message and the stack e.StackTrace.

                Ex :

                try {

                }
                catch( Exception e)
                {
                Print(" Error : "+e.Message+" Stack : "+e.StackTrace);
                }

                Hope it helps

                Comment


                  #9
                  I understand your time is valuable. To answer your question directly, the message you saw generated during OnRender is typically the result of a relative index reference rather than an absolute index reference. This is to say that methods that start counting with 0 as the current bar should not be used during OnRender. Methods that treat 0 as the least recent bar are safe, as are methods that take DateTime objects as arguments.

                  Since you are mentioning drawing ellipses, the Draw.Ellipse method has an overload which takes a DateTime as an argument. I recommend using this overload in your code. If you are already doing this and this behavior persists please let us know. You can store a DateTime that correlates to a bar during OnBarUpdate by referencing Time[0] .
                  Jessica P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by FrancisMorro, Today, 03:24 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post FrancisMorro  
                  Started by Segwin, 05-07-2018, 02:15 PM
                  10 responses
                  1,769 views
                  0 likes
                  Last Post Leafcutter  
                  Started by Rapine Heihei, 04-23-2024, 07:51 PM
                  2 responses
                  30 views
                  0 likes
                  Last Post Max238
                  by Max238
                   
                  Started by Shansen, 08-30-2019, 10:18 PM
                  24 responses
                  943 views
                  0 likes
                  Last Post spwizard  
                  Started by Max238, Today, 01:28 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post Max238
                  by Max238
                   
                  Working...
                  X