Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to detect if an indicator is run in Optimization mode

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

    How to detect if an indicator is run in Optimization mode

    Is there a way to check in Ninjascript, if an indicator is being run in Optimization mode ?
    I see that this topic has been covered in the past, but I can't seem to get it working in NInjaTrader latest version.
    Thanks.

    #2
    Hello Louis335,

    An indicator cannot detect that but you could from the host strategy. You could then pass a bool true/false as an input to your indicator to tell it what the state of the optimization is. You can see the following post for an example of a strategy detecting an optimization:



    From the indicator you could make a bool user input and then when calling the indicator from the strategy pass the true or fall depending on if its in the optimization.


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

    Comment


      #3
      Thanks Jesse,
      In your reference post, Matthew seemed to imply that this was possible, wondering if something similar might be available, possibly undocumented, mentioned in post 5:

      Nothing as straight forward as the Category type, but here is something you can do. The indicator will either have a "Parent" or an "Owner" depending on how it's implemented. This is a quick way to test, but again since these are undocumented, this could change in a future release.

      Thanks,
      Louis

      Comment


        #4
        Hello Louis335,

        Thank you for the reply.

        I had noted what you asked is possible but you have to do it from the strategy and pass the value to the indicator. Indicator's don't have strategy properties, if the indicator should know about something in the strategy then the strategy needs to pass that data to the indicator.

        The post I had linked shows how you can detect an optimization in your strategy, based on that property you could tell the indicator its in an optimization or not. Indicators cannot be in the optimizer alone so the strategy which you are executing needs to tell the indicator whatever you need.



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

        Comment


          #5
          Ok,
          thank you.
          Best,
          Louis

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by tradingnasdaqprueba, 04-09-2024, 09:52 AM
          6 responses
          26 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by PaulMohn, Today, 02:06 AM
          1 response
          3 views
          0 likes
          Last Post PaulMohn  
          Started by Mindset, Today, 01:27 AM
          0 responses
          5 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by EB Worx, 03-07-2023, 05:05 AM
          4 responses
          99 views
          1 like
          Last Post cls71
          by cls71
           
          Started by patricia70, 11-23-2020, 10:17 AM
          17 responses
          549 views
          1 like
          Last Post PaulMohn  
          Working...
          X