Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Objects disappear

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

    Drawing Objects disappear

    Hallo,

    I have programmed an indicator which properly does it's calculations.
    If it's values reach certain levels, it draws a triangle into the chart:

    double offset=ATR(10)[0];
    DrawTriangleUp("MyTriangleUp", true, 0, High[0]+offset, Color.Green);

    However, when I scroll through the chart there are some triangels which disappear
    during scrolling. Even when I scroll back they don't appear any more.
    The indicator values themself don't change when disappearing happens.
    Might there be a bug?
    Seems like disappearing takes place whenever triangels are closed to each other (max. 15 candles away from each other).

    #2
    Stephan123, thanks for the post - what exact NT version are you using here as you observe this? You can check it under Help > About in the software.

    If you scroll the chart and the issue appears, do you see any log error entry then in the right most tab of the Control Center?

    Thanks,

    Comment


      #3
      I use 7.0.1000.2
      Seems like there are no entries generated in the log file if disappearing happens.
      However, there are entries generated during every compiling procedure,
      which are related to a strategy, which is not used during occurence of the
      disappearing. The strategy itself runs without errors and compiling works out as well, though. That's the related entry:

      03.05.2011 14:35:09 Strategy Failed to call method 'Initialize' for strategy 'MrWeitII/1e3beee8ae054e1b8d300f0189b4be9a': Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

      Comment


        #4
        Yes, this entry is seen as the Initialize() is called across all scripts and not only the particular one you're running, so it would good to inspect this strategy's Initialize() to determine where you could run into accessing an empty object then to be able to fix it.

        I would also suggest to upgrade to our R4 via Help > Download Site and then retest your script.

        Comment


          #5
          I have updated to R4. Still same problem.
          I checked the Initialize of the mentioned strategy.
          Nothing obvious. Here it is.

          Code:
          protected override void Initialize()
                  {
                      Add(DoubleStochastics(Close, 12));
                      double Variable1 = 4.5*ATR(20)[0];
                      double Variable2 = 1.5*ATR(20)[0];
                      SetStopLoss("Long-Entry", CalculationMode.Price, Variable1, true);
                      SetProfitTarget("Long-Entry", CalculationMode.Price, Variable2);
          
                      CalculateOnBarClose = true;
                  }
          There is definitely something weird with it.
          After upgrading there were even less signals plotted on the chart, although they should have. After recompiling the indicator I got the same behaviour as before-disappearing triangels in the chart.

          Comment


            #6
            Stephan, please move the logic for your dynamic Stoploss to the OnBarUpdate() section, this is something we don't recommend doing in the Initialize() as the bars object is the not yet guaranteed to be present, while it would be in OnBarUpdate().

            For the indicator script still giving you issues: would you mind us testing it here on our end?

            Comment


              #7
              -Removed the dynamic SL and TP .
              Log entry doesn't occure anymore.
              DIssappearing still occures.
              I can send you the script.
              Where should I send to?

              Comment


                #8
                Ok, thanks for offering Stephan - please contact me directly at: support at ninjatrader dot com - Attn Bertrand.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                594 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                343 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
                556 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                554 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X