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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        41 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X