Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Color coded MA's default line thickness

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

    Color coded MA's default line thickness

    I'm having trouble figuring out how to configure my default line thickness. I used code from a sample file to create an HMA which changes color based on its direction. Everything works but I'd like to have a default thickness of 3 or 4.

    Here's are the plot statements I'm presently using.

    Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "HMA_up"));

    Add(new Plot(Color.FromKnownColor(KnownColor.MediumBlue), PlotStyle.Line, "HMA_down"));

    Add(new Plot(Color.FromKnownColor(KnownColor.ControlDark), PlotStyle.Line, "HMA_neutral"));

    Can you help?

    Thanks,

    Ron

    #2
    Instead of using that color, use a Pen.

    new Pen(Color.Red, 3);
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      actually I tried that already but I keep getting error messages,
      "No overload for method "add" takes "2" arguments"

      Could you type the line as it ought to appear in the code...I seem to have a syntax error no matter what I try.

      Thanks

      Comment


        #4
        Add(new Plot(new Pen(Color.Red, 2), PlotStyle.Line, "SomePlot"));
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          That works just fine.

          Thank You!

          Comment


            #6
            I am getting the same message no overload method for "A2Indicator" takes 20 aruments.

            I just want to use one variable when i reference this indicator in my strategy as it has alot of parametes to be set.

            A2Indicator myIndicator = new A2Indicator(1, 7, 0, 8, userinput1, 13, 0, 1, 1, 5, 1, userinput2, 1, 3, 3, 7, 1);

            Comment


              #7
              bologc,

              Means your indicator does not take 20 parameters. You need to follow whatever the Intellisense shows up for your amount of parameters.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              579 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X