Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Brandon H.NinjaTrader Customer Service

    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.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by lightsun47, Today, 03:51 PM
        0 responses
        2 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        8 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        41 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        8 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X