Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawObjects Backtesting Issue

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

    DrawObjects Backtesting Issue

    Hello there,

    While attempting to use an indicator that relies on DrawObjects for updating already drawn out objects in backtesting, I have come to realize that for some odd reason, DrawObjects reports not saving any of the objects in Ninjascript despite the Strategy Analyzer chart being filled with DrawObject tags for referencing.

    The indicator itself works completely fine in realtime and does report DrawObjects being stored and easily accessible through Ninjascript.

    Is there any reason why this might be happening and if so, how might I remedy this situation?
    Last edited by Kaledus; 04-19-2024, 01:35 PM.

    #2
    Hello Kaledus,

    Can you provide more detail about how you are accessing the drawing objects? Are you using the DrawObjects collection?

    Comment


      #3
      Yes it is the DrawingObjects collection. That is how the indicator is looking for tags when making changes. The count reads 0 in backtesting and cannot find tags. This is not true while using it on realtime charts though.

      Comment


        #4
        Hello Kaledus,

        That is because the DrawObjects collection is a live updated collection and is not in sync with the indicator using it. When using this normally it will only work in realtime after the collection has been populated with the charts object collection.

        Is your indicator that uses the draw objects collection also the one drawing the objects?

        Comment


          #5
          The indicator is indeed using the draw objects collection and drawing the objects. Would I need to incorporate the indicator code into the strategy code itself to make use of the drawing object collection?

          Comment


            #6
            Hello Kaledus,

            No that is not the problem, the draw objects collection is not populated during historical bars. If your indicator is what draws the objects you could keep track of the objects during historical and realtime tests by making your own collection. If your indicator collects objects from other indicators then there is no way to replicate that in a backtest.

            Comment


              #7
              Thank you for the suggestion. I have updated the indicator with the addition of a historical collection and all is good again. I appreciate the help!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              59 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              134 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              74 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X