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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      57 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      78 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      41 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      101 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      61 views
      0 likes
      Last Post PaulMohn  
      Working...
      X