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

Variable to determine if indicator is running within Market Analyzer?

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

    Variable to determine if indicator is running within Market Analyzer?

    Market Analyzer has the ability to add an indicator as a column. Is there a flag or variable that the indicator can key off of to tell if it is running within Market Analyzer (as opposed to a normal chart?)

    I tried looking at something like "ChartControl == null", but this is inconsistent, when you pull up the parameters, etc.

    Any help is greatly appreciated!
    Daniel

    #2
    Hello neoikon,
    Thanks for posting today.

    After testing this using the ChartControl == null should be working when launching in the market analyzer.

    Can you send a sample of your script that shows when this is not working (inconsistent) as an exported script?

    1. From the Control Center window select the menu File > Utilities > Export NinjaScript to open the "Export NinjaScript" dialog window
    2. Select the option "Export selected source files"
    3. Enter a user defined file name
    4. Select all of the files that you want to export and either double click on them or press the ">" button
    5. A list of all files that will be exported
    6. Press the "Export" button to export the selected files
    7. A NinjaScript Archive File (.zip) file will be created in My Documents\<NinjaTrader Folder>\bin\Custom\ExportNinjaScript


    I look forward to your reply.
    Last edited by NinjaTrader_AlexG; 03-31-2015, 09:38 AM.
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      Yes, it does work well in the case for Market Analyzer, but when that same indicator is used on a chart (where it resides most of the time), the ChartControl is still sometimes null (such as when you are pulling up the parameters), etc.

      Unfortunately, my script is a couple thousand lines long and isn't something I can share. But, thanks for the offer though.

      I was hoping there was a hidden flag set by NT that I could key off of.

      Comment


        #4
        Hello neoikon,
        Thanks for the reply.

        NinjaTrader does not have a hidden flag however their is a potential workaround using the ChartControl object.

        If you override the OnStartUp() method to include your check for the ChartControl object. This will perform the check only once prior to the start of your script processing the logic in OnBarUpdate() but after the Initialize() method.

        Here is a link to the help guide describing the OnStartUp() method.
        http://www.ninjatrader.com/support/h...?onstartup.htm

        Please let me know if this is able to work for your scripting needs.
        Alex G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        3 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Working...
        X