Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trend Magic plot lineColor

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

    Trend Magic plot lineColor

    Hi everyone,

    I am trying to build a strategy referring Trend Magic indicator’s color as a condition. I did some research here and found NT’s Brandon H’s suggestions of AddPlot and then assign lineColor[0].
    I tried to add:

    AddPlot(Brushes.Blue, lineColor)
    Values [1][1] = lineColor [0]

    The script compiled fine. A plot was added but the data was n/a in data box.

    Can anyone please help me?

    With Gratitude,

    #2
    Hello ttmafox,

    Thanks for your post and welcome to the NinjaTrader Forums!

    Did you modify the TrendMagic indicator script itself so that it is calling AddPlot() and assigning lineColor[0] to the plot?

    The TrendMagic plot could be found on this User App Share page: https://ninjatraderecosystem.com/use...d/trend-magic/

    The TrendMagic indicator plot is set based on a private custom Series variable called lineColor. When lineColor[0] evaluates to 1, the color of the plot is set to a default color of green. When lineColor[0] evaluates to 0 or -1, the bar color is changed to a default color of red.

    To use the TrendMagic indicator's custom series "lineColor" in the Strategy Builder to change the color of the background, you would need to manually modify the TrendMagic indicator. A plot would need to be added to the indicator using the AddPlot() method and the plot would need to have the lineColor[0] value assigned to it.

    You could then reference that newly added plot in Strategy Builder strategy conditions. For example, if you call AddPlot() to add a plot to the indicator and assign lineColor[0] to that plot, you could reference if the added plot is -1, 0, or 1 to determine the color of the TrendMagic plot in a condition.

    See this help guide page for more information about AddPlot() and sample code: https://ninjatrader.com/support/help...t8/addplot.htm

    See this help guide page for more information about custom Series<T> variables: https://ninjatrader.com/support/help...t8/seriest.htm

    Below is a link to a forum post with helpful information about getting started with NinjaScript.
    https://ninjatrader.com/support/foru...040#post786040


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Programming is beyond me. Did you get this to work? I was trying to build a Strategy using Trend Magic as well, but there is only one choice for Plot and that is Orange for some reason. I don't have the skills to add plots to the indicator so I can build a Strategy. Appreciate any help.

      Comment


        #4
        Hello HeyTFox,

        Thanks for your notes.

        If you need someone to write this script for you and add this method call on your behalf, you can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script.

        You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!

        https://ninjatraderecosystem.com/sea...mming-services

        Educators - https://ninjatraderecosystem.com/sea...ures=education

        You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

        This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X