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

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 giulyko00, Today, 12:03 PM
              0 responses
              1 view
              0 likes
              Last Post giulyko00  
              Started by AttiM, 02-14-2024, 05:20 PM
              12 responses
              213 views
              0 likes
              Last Post DrakeiJosh  
              Started by cre8able, 02-11-2023, 05:43 PM
              3 responses
              238 views
              0 likes
              Last Post rhubear
              by rhubear
               
              Started by frslvr, 04-11-2024, 07:26 AM
              8 responses
              117 views
              1 like
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              10 responses
              47 views
              0 likes
              Last Post stafe
              by stafe
               
              Working...
              X