Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Line Class Parameters

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

    Line Class Parameters

    Hello All:

    I use the strategy wizard on a 3rd party indicator. The wizard produces an argument called Line(15) which gives me a compilation error "NinjaTrader.Gui.Chart.Line is a 'type' but is used like a 'variable' . Code CS0118

    I see the Line Class is used in their indicator yet I cannot comprehend how the parameters should be passed correctly for the Line(15) argument. I have included a pic to clarify what I am trying to do. Any help would be greatly appreciated.
    Attached Files

    #2
    Hello geekodude,

    Thank you for your post.

    Please attach a screenshot of the error with the name and description fields clearly readable after double clicking on the error.

    To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CRTL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

    I look forward to your response.

    Comment


      #3
      Line Class Parameters

      The uploaded file (called ErrorPic1) shows the strategy wizard generated the paramter called Line(15) producing the error.

      The 2nd uploaded file (called Indicator Parameters) shows the Line parameter as a class.

      How should the parameter(s) be passed?
      Attached Files

      Comment


        #4
        Hello geekodude,

        Thank you for your response.

        I do not fully understand what you are trying to do here.

        Can you provide a screenshot of the Strategy Wizard where you are setting this parameter?
        What are the other options available for this parameter for the ncatDynamicSrZones?

        I look forward to your response.

        Comment


          #5
          Line Class Parameter

          Hi Patrick:

          Let me clarify what I am trying to do...

          The Strategy Wizard produces a snippet of the code below.

          protected override void Initialize()
          {

          CalculateOnBarClose = false;
          }

          /// <summary>
          /// Called on each bar update event (incoming tick)
          /// </summary>
          protected override void OnBarUpdate()
          {
          // Condition set 1
          if (GetCurrentBid() < ncatDynamicSRZones(false, false, "Alert4.wav", Line(15), Color.DodgerBlue, 20, "399522", true, Color.Red, 80, Color.Green, 80, Line(35), Color.Red, 20, Color.Green, 20, Line(25)).Lower1[0])
          {
          EnterLong(DefaultQuantity, "LongWeakZone1");
          }
          }

          Notice I colored the Line(15), Line (35), & Line(25) parameters RED.

          These parameters are giving compile time errors.

          When I hover over the ncatDynamicSrZones text, I notice the Line normval is of type Line Class. See Indicators Values uploaded pic for more clarity.

          Thus, I need to substitute Line(15) parameter and pass the CORRECT parameters i.e. instead of Line(15) by itself it should be Line(xx, yy, zz, 15 "some string"). I need to know what xx, yy, zz etc. are since this is a Line class.

          NinjaTrader help states the Line Class is defined as follows:

          Definition
          Objects derived from the Line class are used to characterize how an oscillator line is visually displayed (plotted) on a chart.



          Syntax

          Line(Color color, double value, string name)

          Line(Pen pen, double value, string name)


          Sorry for being so long-winded about this. I am just learning C# & its vagaries.

          Comment


            #6
            Hello geekodude,

            Thank you for your response.

            Can you provide the indicator ncatDynamicSRZones so I may test this matter on my end?

            Comment


              #7
              Line Class Parameters

              Hi Patrick here you go...
              Attached Files

              Comment


                #8
                Hello geekodude,

                Thank you for your response.

                I have tested this item on my end and I can not call the lines either. Please contact the developer of the indicator for further assistance on calling this indicator in NinjaScript.

                Please let me know if you have any questions.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sjsj2732, Yesterday, 04:31 AM
                0 responses
                32 views
                0 likes
                Last Post sjsj2732  
                Started by NullPointStrategies, 03-13-2026, 05:17 AM
                0 responses
                286 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                283 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                133 views
                1 like
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                91 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Working...
                X