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

Simple one, how to get user input colors for DrawText?

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

    Simple one, how to get user input colors for DrawText?

    Hi There,

    I've got everything with my indi working nicely. Thanks to one of the nice users here they guided me on how to toggle between drawing objects on the price chart, and on the indicator chart. i've got a user-selectable font size for my drawtext, but i'd also like a user-selectable color for it, so that it will show up nicely on dark, or light colored backgrounds.

    Here's my line of code, which works fine. It prints the price of the lowest low minus one tick, below the lowest low of the last x bars (since crossBelow0BarsAgo, something figured out elsewhere) on the price chart.

    DrawText("ShortText",false,(Low[LowestBar(Low, crossBelow0BarsAgo)]-TickSize).ToString(), LowestBar(Low, crossBelow0BarsAgo), Low[LowestBar(Low, crossBelow0BarsAgo)]-3*TickSize,0, Color.Orange, new Font("Arial Bold", fontSize), StringAlignment.Center, Color.Transparent, Color.Transparent, 0 );

    I'd just like to have the Color.Orange something that can be changed based on the inputs of the indicator, and i'm not too sure how to do that. I poked around the forum a bit, but couldn't find anything on it.

    Hopefully it's an easy question, i'm still learning how to program.

    Thanks so much!
    Orange.1

    #2
    Mr. Orange, please take a look at this reference sample that demonstrates how to program/create user definable color inputs.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks Austin, that worked like a charm.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Stanfillirenfro, Today, 07:23 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      2 responses
      22 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by olisav57, Yesterday, 07:39 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cocoescala, 10-12-2018, 11:02 PM
      7 responses
      944 views
      0 likes
      Last Post Jquiroz1975  
      Started by oviejo, Today, 12:28 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X