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 PhillT, 04-19-2024, 02:16 PM
          4 responses
          30 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Started by ageeholdings, 05-01-2024, 05:22 AM
          5 responses
          36 views
          0 likes
          Last Post ageeholdings  
          Started by reynoldsn, Today, 02:34 PM
          0 responses
          7 views
          0 likes
          Last Post reynoldsn  
          Started by nightstalker, Today, 02:05 PM
          0 responses
          12 views
          0 likes
          Last Post nightstalker  
          Started by llanqui, Yesterday, 09:59 AM
          8 responses
          29 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Working...
          X