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 rhyminkevin, Yesterday, 04:58 PM
      5 responses
      62 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Started by realblubb, Today, 09:28 AM
      0 responses
      2 views
      0 likes
      Last Post realblubb  
      Started by AaronKoRn, Yesterday, 09:49 PM
      1 response
      18 views
      0 likes
      Last Post Rikazkhan007  
      Started by ageeholdings, Today, 07:43 AM
      0 responses
      12 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Working...
      X