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 techgetgame, Yesterday, 11:42 PM
              0 responses
              8 views
              0 likes
              Last Post techgetgame  
              Started by sephichapdson, Yesterday, 11:36 PM
              0 responses
              2 views
              0 likes
              Last Post sephichapdson  
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,613 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Yesterday, 05:56 PM
              0 responses
              10 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              20 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Working...
              X