Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Making placement, font size and color variable of indicator option pulldown list.

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

    Making placement, font size and color variable of indicator option pulldown list.

    How do I go about making the placement, color and size of text that is going onto graph variable in a pulldown list that can be controlled from the indicator options on the right hand side when adding an indicator?

    For example, if I were making an alert for an SMA crossover and when a bar that was under the SMA closed over the SMA it would flash a message in the top left, top right, bottom left or bottom right and the alert would be a variable text size and color.

    Thank you kindly in advance.

    #2
    Hello 8DTK8,

    You can do this with public properties.

    Font Size:
    Create an integer input in the indicator wizard. You would then use this variable name instead of specifying the font size. You'd have to use the advanced overload for DrawTextFixed that supports font specification.

    Example:
    new Font ("Arial", myFontSize)

    Color:
    See this reference sample for help on creating custom color inputs:
    User Definable Color Inputs

    TextPosition:
    You would need to create a variable with type TextPosition, and a public input for this.
    Example:
    In variables Region:
    private TextPosition myTextPosition = TextPosition.TopLeft;


    In properties Region:
    public TextPosition MyTextPosition
    {
    get { return myTextPosition; }
    set { myTextPosition = value; }
    }

    When you access in code, use the name MyTextPosition.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RubenCazorla, 08-30-2022, 06:36 AM
    3 responses
    77 views
    0 likes
    Last Post PaulMohn  
    Started by f.saeidi, Yesterday, 12:14 PM
    9 responses
    23 views
    0 likes
    Last Post f.saeidi  
    Started by Tim-c, Today, 03:54 AM
    0 responses
    3 views
    0 likes
    Last Post Tim-c
    by Tim-c
     
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    5 views
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,772 views
    0 likes
    Last Post Leafcutter  
    Working...
    X