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 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