Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ConstantLine Indicator

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

    ConstantLine Indicator

    Hello All,
    To identiry possible future support / resistance price levels, often lines are drawm at swing highs and lows , also Market Profile charts may be used to indentify these price levels.
    Once drawn on a chart , transferring these lines to other charts of the same symbol, can be a very time consuming and tedious.
    Ninja has an indicator called ConstantLines, with the ability to draw four lines and no default setting

    My question is ;
    (1) Can the number of lines be increased to 12
    (2) Can this indicator have a default setting , button , so that once lines are drawn to certain levels, press the button , these lines become the default setting , and all lines can be transferred to another chart of the same symbol , by just applying the indicator

    Thanks
    Michael B

    #2
    1) You can make a custom variant of the default indicator to include 12 lines. Just add 8 more plots, 8 more line variables, and set the value 8 more times. Basically duplicate the way the current code is working 8 more times.

    2) You can preset the default values by hard coding them in, but we do not support the creation of a button you could press that would save the values.
    Code:
    Line1Value = 502;
    Line2Value = 609;
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Errors in NT generated code

      Josh
      I did as you suggested and generated a 15 lines ConstantLine Indicator (CL15ES). I intend to add my SR lines and market profile values -hard coded- on a daily basis. After correcting several errors, I still have a couple that I cannot correct as they appear in the Ninja generated code area. In lines 400 and 399 it expects to see a " } ". However, I can see the " } " where they are supposed to be.

      So what is the problem? I am not a programmer but I can modified a few things in some indicators. Your suggestion was one of them.

      Indicator attached

      Thanks

      Carlos
      Attached Files
      Last edited by CarlosAlberto; 11-04-2007, 08:18 AM. Reason: typo

      Comment


        #4
        Hi Carlos,

        You forgot to end the last Line15 set.
        This is what you have
        Code:
        [Description("Line 15 Value")]
        [Category("Parameters")]
        public double Line15Value
        {
            get { return line15Value; }
            set { line15Value = value; }
        This is what it should be
        Code:
        [Description("Line 15 Value")]
        [Category("Parameters")]
        public double Line15Value
        {
            get { return line15Value; }
            set { line15Value = value; }[COLOR=Red]
        }[/COLOR]
        Also you are going to need to duplicate this code segment up to 15
        Code:
        [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries Line4
        {
            get { return Values[3]; }
        }
        At the end you should have this for your Line15
        Code:
        [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries Line15
        {
            get { return Values[14]; }
        }
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          modification

          Could the constantline Indicator be modified to plot horizontal rectangles with a width of say 5 ES points and an opacity of say 3, instead of lines?

          Comment


            #6
            Hello,


            Yes you could do this following similar logic. Code it and let us know if you get stuck so we can assist.

            This link on DrawRectangle will get you started:
            DenNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ScottWalsh, 04-16-2024, 04:29 PM
            7 responses
            34 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cls71, Today, 04:45 AM
            0 responses
            3 views
            0 likes
            Last Post cls71
            by cls71
             
            Started by mjairg, 07-20-2023, 11:57 PM
            3 responses
            214 views
            1 like
            Last Post PaulMohn  
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            4 responses
            546 views
            0 likes
            Last Post PaulMohn  
            Started by GLFX005, Today, 03:23 AM
            0 responses
            3 views
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Working...
            X