Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with finding drawing objects in my strategy

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

    Problems with finding drawing objects in my strategy

    Hi, I have noticed a problem in my strategy and do not know what to do, maybe someone can help me?
    The following problem: I can't find any drawing objects, why?
    In a test strategy everything works without problems

    I made a video about it, in which everything is quite clearly visible. On the left is my strategy and on the right the test strategy

    Video: https://youtu.be/YBUc-XA5yIs

    Click image for larger version

Name:	Screenshot_1.jpg
Views:	265
Size:	393.6 KB
ID:	1159641
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    Thank you for the post.

    The strategy would need to have a bar close in realtime to see any objects in the draw objects collection, it looks like you are using a condition which would equate to a historical bar in the image so that would not allow for any objects to be printed.

    Please try removing the condition so the print always happens and then also allow the script to close a bar in realtime or switch to OnEachTick processing to see if that helps.


    Please let me know if I may be of additional assistance.

    Comment


      #3
      Hi _Jesse, that can't be, because otherwise it wouldn't work with both strategies. in my example both strategies are loaded on the same chart and both are calculated on OnBarClose()

      I tried it anyway, only with:
      Code:
      foreach (DrawingTool draw in DrawObjects.ToList())
      {
         base.Print(draw.Tag);
      }
      The same result. In the test strategy everything ok, and in my strategy nothing

      Click image for larger version

Name:	Screenshot_1.jpg
Views:	272
Size:	516.7 KB
ID:	1159676
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      Comment


        #4
        Hello sidlercom80,

        Unfortunately that detail doesn't really help to know why the one strategy is not seeing the objects.

        If the strategy on the left in the image is not working I would suggest to reduce it until you find the code which is causing the issue. It may instead be easier to work up from the sample on the right as that is working, you could try adding code to the sample on the right to see if something prevents the objects from being seen when added.


        Please let me know if I may be of further assistance.

        Comment


          #5
          Hi _Jesse, if I do it this way, it goes like this:

          Code:
          foreach (IChartObject obj in chartWindow.ActiveChartControl.ChartObjects)
          {
              DrawingTool draw = obj as DrawingTool;
              if (draw != null) 
                 {
                      base.Print(draw.Tag);
                 }
          }
          I don't understand the world anymore Is there a simple explanation for this?
          sidlercom80
          NinjaTrader Ecosystem Vendor - Sidi Trading

          Comment


            #6
            Hello sidlercom80,

            Unfortunately from the given details I couldn't tell you what may be happening there. The best way to diagnose the problem is to compare the working script vs the non working script to see whats different. Your script on the left is not simplified, you have some other code in the script so it would be best to remove all of the modifications to see if any part is affecting the strategy. I also can't see the defaults for each script to see if either has any different setup.

            I look forward to being of further assistance.

            Comment


              #7
              ok, thanks anyway

              sidlercom80
              NinjaTrader Ecosystem Vendor - Sidi Trading

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              50 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              126 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              69 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              42 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X