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

Help with MultiLines Program

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

    #16
    Hi Chelsea,
    I’m still having a problem.
    These are my steps.
    1. I removed all of my charts.
    2. I created one new chart for ES 03-14 (5 min).
    3. I opened indicator “GRTMultiLinesModified”.
    4. When the indicator opens, it has 41 as a preset in “Number of lines” in the Parameters section.
    5. Change “MidPoint of lines” from 0 to 1880.
    6. Click Apply.
    7. Note that the lines are not added to the chart.
    8. Also note that the “Number of lines” changed from 41 to 21 in the Parameters section.

    Best regards,
    Michael

    Comment


      #17
      Hi Michael,

      You were right, I missed a value in the properties that sets for the line number.

      Correction attached.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Thanks Chelsea, it works now.
        I greatly appreciate all of your help!

        Take care,
        Michael

        Comment


          #19
          Hi Chelsea,

          Just found another bug.
          When you initially open the new indicator, you have 41 lines listed in the Plots section.
          When you change the "MidPoint of lines" from 0 to 1880 and click Apply, now you have two Line41s in the Plots section.
          When changing line color and thickness, the first Line41 is functional. The second one is not.

          Best regards,
          Michael

          Comment


            #20
            Hi Michael,

            I'm not sure what caused that bug but the fix was to add the midpoint line last. I think this bug was part of the original script as well.

            I've also turned the setting of colors and widths to a loop and made the midpoint line separate from that loop to prevent onstartup errors if a line count value smaller than 41 is chosen.

            Let me know if you find any other issues with this script.
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              Hi Chelsea,

              Thanks for your help.

              I found two bugs.

              1. In the Parameters, "Number of lines" = 41, but in the Plots, there are 42 lines. This is because Line0 is now showing up.

              2. If you change the "Number of lines" from 41 to 21, the Plots section shows 41 (really 42 for now) lines. Should this section always show the maximum number of lines possible or should this section only reflect the "Number of lines" selected as shown in the Parameters section? I really don't know the answer to this one.

              Best regards,
              Michael

              Comment


                #22
                Hello Phoenix7344,

                When you select 21 lines there will be 22 as there is a mid point line that is added as well. This is by design from the author.

                Also, when it comes to the plots in the parameters, its going to be stuck with the maximum number of lines, however, it should actually plot the right amount on the chart. This is because the code that makes the lines is in Initialize which can't be changed once the indicator instance is added.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Hi Chelsea,

                  The midpoint line is "line01".
                  I tried changing the color of "line00" and no lines on my chart changed color.
                  Also, if you select 21 lines, there will be 21 lines on the chart and not 22.

                  Best regards,
                  Michael

                  Comment


                    #24
                    Hi Michael,

                    Wow, there was quite a bit wrong with this script.

                    I've basically re-coded the whole thing using loops instead of a huge block of if statements.

                    This last attempt looks promising, though after finding this many mistakes i'm not holding my breath.

                    I also added a line of code that sets the midpoint to the simulator feed price in the instrument settings by default. Let me know if you want me to remove this.
                    Attached Files
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      Hi Chelsea,

                      I'm amazed with all the work necessary to get this indicator corrected.
                      I greatly appreciate all of your help.

                      I don't understand the comment you made:
                      " also added a line of code that sets the midpoint to the simulator feed price in the instrument settings by default."

                      What does this do? I don't understand the reason behind setting the midpoint to the simulator feed price. Does this set the midpoint to the price at market open (9:30 AM EST)?

                      Best regards,
                      Michael

                      Comment


                        #26
                        Hi Michael,

                        Thanks for your note.

                        NinjaTrader will often update the simulator feed price using the last price data. We can use this to get a general mid point thats close to the last price used the last time the live feed was open.

                        I can remove this, but it was helpful when i was testing because it put the mid line very close to the current traded price without me having to type it in.

                        Let me know if you don't like this.
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by pmachiraju, 11-01-2023, 04:46 AM
                        8 responses
                        148 views
                        0 likes
                        Last Post rehmans
                        by rehmans
                         
                        Started by mattbsea, Today, 05:44 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post mattbsea  
                        Started by RideMe, 04-07-2024, 04:54 PM
                        6 responses
                        33 views
                        0 likes
                        Last Post RideMe
                        by RideMe
                         
                        Started by tkaboris, Today, 05:13 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post tkaboris  
                        Started by GussJ, 03-04-2020, 03:11 PM
                        16 responses
                        3,283 views
                        0 likes
                        Last Post Leafcutter  
                        Working...
                        X