Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rays, Lines, Fibos as default

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

    Rays, Lines, Fibos as default

    i change the plattaform of ninja7 to ninja 8, and i see i can not set defaults for lines, rays, fibos etc, how can i set default for my indicators?.

    #2
    Hello Fingerman,
    Thanks for your post.

    Do you want to set the default color for those drawing objects inside your indicators code?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      yes, colors, forms, etc

      Comment


        #4
        Fingerman,
        To make a script run with a default setting you would set that brush/property in OnStateChange() inside State.SetDefaults.

        OnStateChange() can be used to filter out different stages of the entire life cycle of a script (SetDefaults, Configure, Historical, Realtime, Terminated, etc.) OnStateChange() is fully covered in the Help Guide here:


        The following snippet demonstrates how you would properly set a brush default in your script, along with the public property for the brush that allows the brush to be changed from the indicators settings.

        Code:
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                MyBrush                    = Brushes.Orange;
            }
        }
        
        [NinjaScriptProperty]
        [XmlIgnore]
        [Display(Name="MyBrush", Order=1, GroupName="Parameters")]
        public Brush MyBrush
        { get; set; }
        
        [Browsable(false)]
        public string MyBrushSerializable
        {
            get { return Serialize.BrushToString(MyBrush); }
            set { MyBrush = Serialize.StringToBrush(value); }
        }

        I suggest using the NinjaScript wizard to generate your inputs or plots so that you can simply copy/paste the public property into your code.
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          omfg, if in ninjatrader7, you can set default witth 1 click, how in ninjatrader 8 need to do script??

          Comment


            #6
            Hello Fingerman,

            Thank you for your response.

            My colleague replied for a NinjaScript indicator. To set the defaults of Drawing Objects you need to double click on the object after drawing it --> set the desired options --> and then select 'template' at the bottom right hand corner of the Drawing Objects window --> select 'save' --> name the template 'Default' --> Save --> OK.

            For information on Drawing Objects please visit the following link: https://ninjatrader.com/support/help..._tools__ob.htm

            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ageeholdings, Today, 07:43 AM
            0 responses
            6 views
            0 likes
            Last Post ageeholdings  
            Started by pibrew, Today, 06:37 AM
            0 responses
            4 views
            0 likes
            Last Post pibrew
            by pibrew
             
            Started by rbeckmann05, Yesterday, 06:48 PM
            1 response
            14 views
            0 likes
            Last Post bltdavid  
            Started by llanqui, Today, 03:53 AM
            0 responses
            6 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            12 views
            0 likes
            Last Post burtoninlondon  
            Working...
            X