Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Marking crosses of two arbitrary indicators

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

    Marking crosses of two arbitrary indicators

    Hi everybody,


    I'd like to be able to draw a cross whenever two indicators cross. This is easy enough if the two indicators are hardcoded in a custom indicator. However, I'd like to set the two indicators in the UI of custom indicator, so that one time I might be marking the crossing of two SMAs and in another situation I might be marking the crossing of two EMAs, using a different instance of the same indicator.

    Is there a way to do this?

    Kind regards, Manu

    #2
    Hello Manu,

    You are wanting the user to be able to select the indicator used for the cross detection similar to the example I have for cross detection?


    There is no documented way of achieving this. I feel that each indicator would need to be hard coded with an enum.

    Below is an example.
    https://ninjatrader.com/support/help...ned_parame.htm

    This thread will remain open for any community members that would like to assist with undocumented ways of achieving this.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea, thank you for your reply.

      I wonder if in C# there is a way to evaluate a piece of string at runtime and use it as code? This way I could have a string input detailing the indicators I want to use and their parameters. What do you think?

      Comment


        #4
        By the way, I can see how the example you provide goes in the right direction. At this stage creating an enum wouldn't be much better than hardcoding the choices within the script, but it's a good suggestion, thank you.

        Comment


          #5
          Hello Manu,

          It may be possible to convert string values to executable code, however, this would be far outside of what is supported by NinjaTrader Support. I'm not familiar with this and I would not be able to provide any guidance.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          598 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          555 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X