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

Color change on price marker

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

    Color change on price marker

    Is there a way to make the price marker change color when price changes?

    #2
    Hello kuriakos,

    The price marker for the chart its self cannot be modified in this way however you could do this with an indicators price marker. An indicators Plot will gain a price marker which can be colored based on conditions or the price changing.


    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse!
      Can you recommend an indicator for NT8 that will do this?

      Comment


        #4
        Hello kuriakos,

        I am not aware of an item that you could download however this is not a difficult item to make.

        The following code could be used for that purpose:

        In OnStateChange set the Calculate setting:

        Code:
         protected override void OnStateChange()
        {
             if (State == State.SetDefaults)
             {
                 Calculate                                    = Calculate.OnPriceChange;
        Then in OnBarUpdate a simple toggle based on the price changes:
        Code:
        private bool counter = false; 
        protected override void OnBarUpdate()
        {
            counter = !counter;
             if(counter)
             {
                 ChartBars.Properties.PriceMarker.Background = Brushes.Red;
             } else {
                  ChartBars.Properties.PriceMarker.Background = Brushes.Blue;    
             }
        }


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          NinjaTrader_Jesse

          Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Taddypole, 04-26-2024, 02:47 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Eduardo  
          Started by futtrader, 04-21-2024, 01:50 AM
          6 responses
          58 views
          0 likes
          Last Post futtrader  
          Started by sgordet, Today, 11:48 AM
          0 responses
          4 views
          0 likes
          Last Post sgordet
          by sgordet
           
          Started by Trader146, Today, 11:41 AM
          0 responses
          5 views
          0 likes
          Last Post Trader146  
          Started by jpapa, 04-23-2024, 07:22 AM
          2 responses
          22 views
          0 likes
          Last Post rene69851  
          Working...
          X