Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PlotColors as strategy trigger

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

    PlotColors as strategy trigger

    Can we use PlotColors as strategy trigger?

    if (SlopeSMA(10).PlotColors[0][0]==Color.Red)
    EnterShort();

    #2
    Hello microsat,

    Thank you for your inquiry.

    As long as the conditional is valid and is able to return a true or false, you would be able to use anything to determine if an entry is triggered.

    In your case, the EnterShort() will be triggered if the plot color for the first plot in the SlopeSMA indicator is red.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Thank you.
      But when the PlotColors[0][0] was called from a strategy, it always returned Color.Empty, although the indictor could work normally to plot three different colors lines.

      Comment


        #4
        Hello microsat,

        Please attempt to use:
        Code:
        if (SlopeSMA(10).Plots[0].Pen.Color == Color.Red)
        Ensure you have Added SlopeSMA(10) in your Initialize():
        Code:
        Add(SlopeSMA(10));
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        60 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        146 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        284 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X