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 Segwin, 05-07-2018, 02:15 PM
      14 responses
      1,788 views
      0 likes
      Last Post aligator  
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      837 views
      0 likes
      Last Post emuns
      by emuns
       
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      6 responses
      3,292 views
      1 like
      Last Post jgualdronc  
      Started by Touch-Ups, Today, 10:36 AM
      0 responses
      12 views
      0 likes
      Last Post Touch-Ups  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      11 responses
      62 views
      0 likes
      Last Post halgo_boulder  
      Working...
      X