Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adjust drawing setting in indicator??

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

    Adjust drawing setting in indicator??

    Hi,

    I just made a really simple indicator that draws the fibs on the last bar printed. See below. Is there a way to access the drawing settings from the indicator? i.e. having access to the extend lines settings, the text location settings, the price levels settings?? Doing this from the indicator rather than having to go into the drawing and changing the settings. Appreciate any help.

    Thanks

    namespace NinjaTrader.NinjaScript.Indicators.MyIndicators
    {
    public class LastBarFib : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Automatically draw fibonacci retracements from the last bar printed.";
    Name = "LastBarFib";
    Calculate = Calculate.OnBarClose;
    IsOverlay = true;
    DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    }
    else if (State == State.Configure)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    if (CurrentBar>0)
    Draw.FibonacciRetracements(this,"myFib",true,0,Clo se[0],0,Open[0]);
    }
    }
    }​

    #2
    Hello tvaughan4,

    Yes, assign the return FibonacciRetracements to a variable, then you can access or modify the properties.

    Below is a link to the help guide with sample code.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you!!

      Comment

      Latest Posts

      Collapse

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