Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StrategyPlot Pen Color

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

    StrategyPlot Pen Color

    Trying to change the Strategy.Plot color based on Value,,, but just doesn't change color, alway blue..
    Did notice in the indicators window there is an entry for color, which probably always overrides what my code says.. any suggestion would be appreciated..

    protected override void OnBarUpdate()

    StrategyPlot(0).Value.Set(profit + Position.GetProfitLoss(Close[0], PerformanceUnit.Currency));

    if (StrategyPlot(0).Value[0] >= 0)
    StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
    else
    StrategyPlot(0).Plots[0].Pen.Color = Color.Red;

    #2
    Hello,

    Are you using NinjaTrader 6.5 or NinjaTrader 7. As depending on what version a different approach to do this is requred.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Ninja Trader 7

      Comment


        #4
        Hello,

        Ok thanks, for this you need to use a multi indicator / plot color approach. Please see this sample o how to do this in NT7.



        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X