Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator taking very long to load

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

    #16
    Hello James,
    I've tested it without tick replay, standard candlestick chart. Earlier it was eating time but after the fix it worked fine without any delay. Rest performance related stuff you need to handle, technical error is fixed. So keep going, good luck.

    Comment


      #17
      s.kinra,
      Thanks again. I found that same error on another indicator I'm working on and it fixed the chart rendering issue that I've been pulling my hair out trying to figure out what was wrong.
      Thank you for your time and knowledge.
      James

      Comment


        #18
        Originally posted by s.kinra View Post
        Hello James,
        Fixed it....

        The issue lies in properties in bottom, you need a small modification. The Brushes needs to be serialized & there I found a small error. Correct it as below:-
        Original:
        [XmlIgnore]
        [Display(ResourceType = typeof(Custom.Resource), Name="Current Price Color", Description="Current price line and text color.", GroupName = "1st Bar Projection", Order = 6)]
        public System.Windows.Media.Brush CurrentPrice_LineText_Color
        { get; set; }

        [Browsable(false)]
        public string CurrentPrice_LineText_ColorSerialize
        {
        get { return Serialize.BrushToString(CurrentPrice_LineText_Colo r); }
        set { CurrentPrice_LineText_Color = Serialize.StringToBrush(value); }
        }




        Modified:
        [XmlIgnore]
        [Display(ResourceType = typeof(Custom.Resource), Name="Current Price Color", Description="Current price line and text color.", GroupName = "1st Bar Projection", Order = 6)]
        public System.Windows.Media.Brush CurrentPrice_LineText_Color
        { get; set; }

        [Browsable(false)]
        public string CurrentPrice_LineText_ColorSerializable
        {
        get { return Serialize.BrushToString(CurrentPrice_LineText_Colo r); }
        set { CurrentPrice_LineText_Color = Serialize.StringToBrush(value); }
        }





        I've highlighted the change you need. You need to do this for all brushes.
        Hope it helps!
        Hello s.kinra,
        Is there a time when a Brush Color does not need to be Serializable? The reason I ask is that I added the ability to change line colors and line style on an indicator that I use and when I plot it on the chart the chart doesn't render properly and will even freeze at times. Also, when a stop or target bubble is on the chart (from the chart trader) you can't click it to move it. When I take the indicator off everything works perfectly. I tried to comment out the Serializable part and seemed to help a little bit but that could just be in my head.

        Edited: I did attach the file with my changes and the original file.

        Thanks again.
        James
        Attached Files
        Last edited by laoshr; 10-07-2021, 05:31 PM.

        Comment


          #19
          Hello James,
          If you need to change color from indicator settings later, brush has to be serialized otherwise not, you can simply use private brush but you won't have ability to change it from indi settings. I'll look into your files later in evening or tomorrow.

          Comment


            #20
            Hello James,
            You haven't shared the addons referred, so I can't compile it. You need to dive in yourself.

            Comment


              #21
              Hello s.kinra,
              Sorry about that. I thought I loaded all the files. Here is the Addon file.
              I find everything runs on a candlestick chart but when loading on my renko chart with the orderflow, that's when all the issues arise.
              Again, sorry for the file not being attached.
              Thank you.
              James
              Attached Files

              Comment


                #22
                Hello James,
                You need to fix errors first. I don't know what your scripts are doing.

                Comment


                  #23
                  s.kinra,
                  Oh no. I'm not getting that error. Let me take another look.
                  Sorry for the time you spent.

                  James

                  Comment


                    #24
                    Hello s.kinra,
                    I don't get that error. I loaded on a chart and I don't see any errors.
                    I copied the file once more in case I made a copy and paste error on my part.
                    I attached the file again.
                    Thank you.
                    James
                    Attached Files

                    Comment


                      #25
                      Hello James,
                      I think you didn't share csv file you're using to plot lines. It may be calling null every time for me.

                      Comment


                        #26
                        s.kinra,
                        Here is the file for the .csv
                        I think my brain isn't working this morning.
                        Thank you.
                        James
                        Attached Files

                        Comment


                          #27
                          Hello James,
                          I couldn't find any noticeable lag between candlestick & renko, the only issue would be Time you're using. Renko would use seconds because it has to render blocks otherwise no issue as such. You can find similar lag with candlestick if you use seconds timeframe with candlestick. For higher timeframes, such as minutes seconds will be ignored, but for renko you can notice on x axis as well seconds are displayed & its not uniform as renko makes brick size uniform.
                          Hope it helps!

                          Comment


                            #28
                            Thank you s.kinra.
                            I think the issue comes with the renko bars, orderflow and the rest of the indicators that are plotting on the chart. It just seems to hang up and it seems pretty random a lot of times. I might have to figure out a different way.
                            Question, is there a way to run an indicator on a time chart and have the lines be global so they plot on the renko chart without having to run the indicator on the renko chart itself?
                            Not sure if that made sense. LOL
                            Thank you again.
                            James

                            Comment


                              #29
                              Hello James,
                              Yes, you can use global lines, it will work on both candlestick & renko for the given instrument. You can refer below syntax for drawing line thru script:-
                              Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)
                              Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, bool isGlobal, string templateName)
                              Hope it helps!

                              Comment


                                #30
                                Ok, awesome. Thanks for offering some hope here.
                                This is the Draw.Line:
                                Draw.Line(this, tag, false, line.SRStartTime, line.SRPrice, endTime, line.SRPrice, lineBrush, dash, (LineWidth), true);
                                So, the bool IsGlobal would be just before the lineBrush?
                                Thanks again.
                                James

                                Edited: I see that the IsGlobal goes just before the end after LineWidth. Is this correct? Looking at the NT reference guide I'm assuming I would use "true" but not really understanding if that would go just before the last "true" in the line of code there.

                                Wow...I feel in over my head here.

                                Thanks again. s.kinra.
                                James

                                Edited:
                                I found a little help reading the reference guide. I created a Global Line and then saved it as a template called myGlobal.
                                I then added that to the end with myGlobal as the template string.
                                Draw.Line(this, tag, false, line.SRStartTime, line.SRPrice, endTime, line.SRPrice, lineBrush, dash, (LineWidth), true, "myGlobal");
                                I get errors though. Attached is the error.
                                Thanks
                                James

                                Edit 3:
                                Ok...I got the line to plot globally across all charts. The issue now is that the line style, width, color, etc... is all the same as the template line. Is there a way to have the user UI be able to change those settings? I have those in the UI now or the current lines.
                                Draw.Line(this, tag, false, line.SRStartTime, line.SRPrice, endTime, line.SRPrice, true, "myGlobal");

                                Thank you s.kinra for pushing me.
                                James
                                Attached Files
                                Last edited by laoshr; 10-08-2021, 01:33 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                601 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                347 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                103 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                559 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                558 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X