Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

isLocked Error

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

    isLocked Error

    Hi,

    i'm trying create and unlocked HorizontalBar, but this code is not working.

    Code:
    double stopPrice = Bars.LastPrice + 10 * TickSize;
    HorizontalLine newLine = Draw.HorizontalLine(this, SL_TAG, stopPrice, Brushes.Red, DashStyleHelper.DashDotDot, 2);
    newLine.isLocked = false;
    NinjaScript File Error Code Line Column
    indicator_sample.cs 'HorizontalLine' does not contain a definition for 'isLocked' and no accessible extension method 'isLocked' accepting a first argument of type 'HorizontalLine' could be found (are you missing a using directive or an assembly reference?) CS1061 181 12


    What's wrong?

    #2
    Hello Powerbucker,

    Thank you for your post.

    You are likely missing some using statements. What using statements are listed at the top of your script?

    Comment


      #3
      using System;

      using System.Collections.Generic;

      using System.ComponentModel;

      using System.ComponentModel.DataAnnotations;

      using System.Linq;

      using System.Text;

      using System.Threading.Tasks;

      using System.Windows;

      using System.Windows.Input;

      using System.Windows.Media;

      using System.Xml.Serialization;

      using NinjaTrader.Cbi;

      using NinjaTrader.Gui;

      using NinjaTrader.Gui.Chart;

      using NinjaTrader.Gui.SuperDom;

      using NinjaTrader.Gui.Tools;

      using NinjaTrader.Data;

      using NinjaTrader.NinjaScript;

      using NinjaTrader.Core.FloatingPoint;

      using NinjaTrader.NinjaScript.DrawingTools;

      Comment


        #4
        Hello Powerbucker,

        It looks like you just need to capitalize IsLocked. I missed that you have .isLocked in your original post.

        Code:
        HorizontalLine newLine = Draw.HorizontalLine(this, SL_TAG, stopPrice, Brushes.Red, DashStyleHelper.DashDotDot, 2);
        newLine.IsLocked = false;
        Please let me know if you have further questions. ​

        Comment


          #5
          OH Thanks !!

          Comment

          Latest Posts

          Collapse

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