Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modding Existing Indicator?

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

    #31
    Hello Bob-Habanai,

    Thanks for your note.

    You could create two conditions in your condition set. One condition checking if the value is < 4 and a second condition that checks if the value is > 1.

    For example, the sample code below demonstrates this.

    Code:
    if (x < 4 && x > 1)
    {
        //do something.
    }
    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #32
      Well, I worked out why I couldn't get
      Code:
      MyDoubleVar.ToString("0.00"));
      work to.

      It's because I was trying to put a int. into the "0.00" i.e.
      Code:
      MyDoubleVar.ToString("Decimalplaces"));
      I changed my int. into a double. but that wouldn't work either. It just displays the text Decimalplaces instead of looking up the 0.0 in the indicator menu.

      Thanks again!

      Comment


        #33
        Hi Bob-Habanai,

        Okay, I see what you're trying to accomplish. Do you really need to have that as a parameter? What I mean is, will you ever change the number decimal places you're going to show?

        If you do want to change, then try this:

        Code:
        string myDoubleFormat = "0";
        if (DecimalPlaces > 0) {  // DecimalPlaces is the int Property
            myDoubleFormat = "0."
            for (int i = 0; i < DecimalPlaces; i++) {
                myDoubleFormat += "0";
            }
        }
        With myDoubleFormat set, then you use
        MyDoubleVar.ToString(myDoubleFormat); // Note: No quotes around myDoubleFormat

        Hope that helps!
        Matt

        Comment


          #34
          Thanks Matt,

          That works perfectly!

          Comment


            #35
            Great to hear! Happy to help!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            573 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X