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

How to run an indicator which uses manually drawn lines in Market Analyzer?

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

    How to run an indicator which uses manually drawn lines in Market Analyzer?

    Dear all,

    I am trying to filter certain indicator signals by initially checking whether price is close enough to manually drawn trendlines on my charts. So my indicator OnBarUpdate() starts with a clause

    Code:
     
    foreach (IDrawObject draw in DrawObjects)
    { 
        if (
        draw.UserDrawn &&
        draw.DrawType == DrawType.HorizontalLine 
        )
        { 
            //Is price close enough to this? If not just return from function, do nothing.
            (...)
        }
    }
    This works perfectly with individual charts once I manually add trendlines to them. However I would like to screen my entire asset universe in this way and so have tried this indicator within Market Analyzer (MA). I find that I never get any signal, and I assume that this is because MA instantiates a non customised Chart object i.e. sees an empty DrawObjects collection in the above block? Is that the case, and if so is there any way I can make MA access the exact Chart instances that I would see if manually opening a chart? Otherwise, can I achieve what I am trying to do in some other way?

    (Bonus question: is there any way to get debug output from the indicator instance running within MA?)

    Sorry if this has been covered before and thanks for your time.

    #2
    Hello hyperfish,

    There is not a supported method to be able to take in line objects inside of the Market Analyzer Window.

    You may use the Print() statement to view values inside of the Output window from the Market Analyzer just like you would the Chart.

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks for confirming JC,

      I would have preferred to find out I had missed an easy way to do this but you cannot have everything! I will have to try and hack something together using file I/O.

      And good to know you can normally debug indicators in MA - I had just assumed you couldn't.

      Thanks again...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rocketman7, Today, 09:41 AM
      4 responses
      15 views
      0 likes
      Last Post rocketman7  
      Started by selu72, Today, 02:01 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by WHICKED, Today, 02:02 PM
      2 responses
      12 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by f.saeidi, Today, 12:14 PM
      8 responses
      21 views
      0 likes
      Last Post f.saeidi  
      Started by Mikey_, 03-23-2024, 05:59 PM
      3 responses
      56 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Working...
      X