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

Access graphical objects from a strategy

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

    Access graphical objects from a strategy

    Hello! I am trying to make the strategy "see" graphical objects drawn by a custom indicator. While my code can "see" the objects drawn on the chart manually, it refuses to catch objects drawn by the custom indicator. Here is my code:

    foreach (IDrawObject obj in DrawObjects){
    Print(obj.Tag);
    }

    Can you please advise me on if I am doing something wrong?

    #2
    Hello,

    Thank you for the post.

    This would not be anything you are doing wrong, this would actually be expected. Only Manually drawn objects or objects drawn by this script could be seen in the collection provided. Other scripts objects would not be seen by this collection.

    You would instead need to edit the indicator that is producing the drawing and expose a plot to be used as a signal. You could then call the other indicator to retrieve its values.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse! Than you for your reply.
      1. Unfortunately, I don't have the indicator's code, since it is purchased from another vendor.
      2. Is there any other collection that handles objects drawn by all scripts on the current chart?
      3. In NT8 I am able to access any objects drawn by any script: is it different to NT7 in this?

      Comment


        #4
        Hello,

        Thank you for the reply.

        In this case, you would likely need to contact the vendor to see if a signal can be exposed in a future update. Unfortunately, there are no collections I could provide that would have other scripts objects in it.

        Going forward in NT8 it is possible to see other script drawn objects, you can locate an example that shows the syntax required to see what is selected here: https://ninjatrader.com/support/foru...87&postcount=6

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          OK, understood! Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DanielTynera, Today, 01:14 AM
          0 responses
          2 views
          0 likes
          Last Post DanielTynera  
          Started by yertle, 04-18-2024, 08:38 AM
          9 responses
          40 views
          0 likes
          Last Post yertle
          by yertle
           
          Started by techgetgame, Yesterday, 11:42 PM
          0 responses
          12 views
          0 likes
          Last Post techgetgame  
          Started by sephichapdson, Yesterday, 11:36 PM
          0 responses
          2 views
          0 likes
          Last Post sephichapdson  
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,615 views
          0 likes
          Last Post aligator  
          Working...
          X