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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      237 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      152 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      163 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      246 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      198 views
      0 likes
      Last Post CarlTrading  
      Working...
      X