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

2 of the same

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

    2 of the same

    very new to NinjaScript and just playing around. If I wanted to write or modify and indicator or strategy and wanted to have 2 of the same indicator (different parameters) referenced. How would I distinguish the two?

    for example.....let's say I'm writing an indicator that does action X when the MACD does action Y. What if on the same chart I had a longer term MACD and wanted to use it in the indicator? How would I distinguish between MACD(1) and MACD(2) ?

    thanks

    #2
    What do you mean by distinguish? Programmatically or visually?
    RayNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ray View Post
      What do you mean by distinguish? Programmatically or visually?
      I suppose I mean progammatically because I can visually see them on my chart. I have the MACD in 1 panel and then a longer term MACD below that in a different panel. I just don't know what to call them in the script so that it knows which MACD I'm referencing.

      Comment


        #4
        You just pass in different parameters. For example:

        Print(MACD(20, 3, 3)[0]);
        Print(MACD(40, 3, 3)[0]);

        Prints out the current bar value for two different MACD's.
        RayNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Ray View Post
          You just pass in different parameters. For example:

          Print(MACD(20, 3, 3)[0]);
          Print(MACD(40, 3, 3)[0]);

          Prints out the current bar value for two different MACD's.

          great. Thx Ray.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Spiderbird, Today, 12:15 PM
          2 responses
          8 views
          0 likes
          Last Post Spiderbird  
          Started by WHICKED, Today, 12:45 PM
          0 responses
          3 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by FrazMann, Today, 11:21 AM
          2 responses
          6 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by rjbtrade1, 11-30-2023, 04:38 PM
          2 responses
          80 views
          0 likes
          Last Post DavidHP
          by DavidHP
           
          Started by lorem, Yesterday, 09:18 AM
          5 responses
          18 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X