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

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 WHICKED, Today, 12:56 PM
          2 responses
          15 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Felix Reichert, Today, 02:12 PM
          0 responses
          1 view
          0 likes
          Last Post Felix Reichert  
          Started by Tim-c, Today, 02:10 PM
          0 responses
          1 view
          0 likes
          Last Post Tim-c
          by Tim-c
           
          Started by cre8able, Today, 01:16 PM
          2 responses
          9 views
          0 likes
          Last Post cre8able  
          Started by chbruno, 04-24-2024, 04:10 PM
          3 responses
          49 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X