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 Tim-c, Today, 03:54 AM
          0 responses
          3 views
          0 likes
          Last Post Tim-c
          by Tim-c
           
          Started by FrancisMorro, Today, 03:24 AM
          0 responses
          2 views
          0 likes
          Last Post FrancisMorro  
          Started by Segwin, 05-07-2018, 02:15 PM
          10 responses
          1,771 views
          0 likes
          Last Post Leafcutter  
          Started by Rapine Heihei, 04-23-2024, 07:51 PM
          2 responses
          31 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          945 views
          0 likes
          Last Post spwizard  
          Working...
          X