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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X