Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Editing an indicator

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

    Editing an indicator

    Hello everyone,

    I've been trying to add a line option so I can set the thickness of a plotted line, the indicator is called "JurbolMultiMAColorSlope"
    it doe not have this in properties.
    I have added this and it is available in properties now using this code bellow

    [NinjaScriptProperty]
    [Range(1, int.MaxValue)]
    [Display(Name="Line", Order=1, GroupName="Parameters")]
    public int Line
    { get; set; }

    I have also added in the SetDefaults see bellow.

    Line = 3;

    It gives me the option to change the thickness in a new parameter but it does nothing
    I need to have a "Plots" Line opion

    The State.Configure is as bellow

    AddPlot(Brushes.Orange, "MA");

    Adding a value of 3 does not help see bellow

    AddPlot(Brushes.Orange, 3, "MA");

    I have read the ninjascript help guides for about a week now i think i may have confused myself
    Any help would be greatfull

    thankyou
    Last edited by Christopher Leggit; 11-01-2021, 12:23 AM.

    #2
    Hello Christopher Leggit,

    You would need to use that property now. The AddPlot statement would be where you could use that by using the other overload which includes a Stroke:

    Code:
    AddPlot(Stroke stroke, PlotStyle plotStyle, string  name)
    Code:
    AddPlot(new Stroke(Brushes.Blue, [B]Line[/B]), PlotStyle.Bar, "MyPlot");
    You can see the ways Stroke can be used here: https://ninjatrader.com/support/help...ightsub=stroke

    The other change would be that you need to move AddPlot to State.Configure like shown in the alternate sample in the help guide: https://ninjatrader.com/support/help...ghtsub=addplot

    You set the default in SetDefaults, a user picks a different value and then State.Configure can see either the default or what the user had changed to.


    Please let me know if I may be of further assistance.

    Comment


      #3
      That was it, how simple it is thank you Jesse I'd been cursing myself knowing it was something so small

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      332 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
      553 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