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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      46 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X