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 Creamers, 04-27-2024, 05:32 AM
              13 responses
              74 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by tradebot, Yesterday, 01:25 PM
              4 responses
              18 views
              0 likes
              Last Post tradebot  
              Started by manueldecastro, Yesterday, 10:26 AM
              5 responses
              24 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by memonic, 05-01-2024, 01:23 PM
              5 responses
              31 views
              0 likes
              Last Post memonic
              by memonic
               
              Started by dcriador, Yesterday, 10:45 AM
              2 responses
              21 views
              0 likes
              Last Post dcriador  
              Working...
              X