Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change colors of PriceLevels in drawing tool

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

    Change colors of PriceLevels in drawing tool

    Hi,

    I'm experimenting with the drawing tools. (Andrews pitchfork to be precise)

    In the case State.Configure: there are 3 levels Pricelevels created:

    PriceLevels.Add(new PriceLevel(0, Brushes.Blue));
    PriceLevels.Add(new PriceLevel(50, Brushes.Blue));
    PriceLevels.Add(new PriceLevel(100, Brushes.Blue));
    Once these are created how can I change the color?
    I presume I need to change this code to make the levels global like this:

    #in variables:
    PriceLevels level1, level2, level3;

    case State.Configure:
    level1 = PriceLevels.Add(new PriceLevel(0, Brushes.Blue));
    level2 = PriceLevels.Add(new PriceLevel(50, Brushes.Blue));
    level3= PriceLevels.Add(new PriceLevel(100, Brushes.Blue));
    Down in the code I would like to do something like this:

    level1.color = red;

    Is that possible ? or how would I do that now in NT8?

    Many thanks in advance

    Wessel
    Last edited by Wessel; 11-07-2015, 02:55 PM.

    #2
    Hello Wessel,

    Thank you for writing in.

    The simplest way would be to do the following:
    Code:
    PriceLevels[0].Stroke = new Stroke(Brushes.Red);
    PriceLevels[1].Stroke = new Stroke(Brushes.Green);
    PriceLevels[2].Stroke = new Stroke(Brushes.Yellow);
    Please let me know if I may be of further assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Excellent!

      That works great!

      Wessel

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      148 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,282 views
      0 likes
      Last Post Leafcutter  
      Working...
      X