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

MultiPeriod Colored Trix

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

    MultiPeriod Colored Trix

    So I tried to put together a multi-colored (depending on slope), 2 period trix (similar to the THV system Trix), but ran into an issue. Whenever the slop changes, it just prints nothing. I've attached my script and a screenshot of what I'm talking about. Any help would be much appreciated.

    Thank you
    Attached Files

    #2
    Hi jmflukeiii,

    The approach you're using is one that was used for NinjaTrader 6.5, but now is outdated since we added PlotColors[] [] approach in version 7. You can read more about how to do this here:


    Please be sure to check the NT7 version.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      It should still work though....

      In that sample script, what is the point of calculating the middle? Why can't you just use the close of the SMA or whatever it may be and ask it to test whether that is rising or falling? I'm not sure what Rising or Falling does - does it compare a current value to the previous value I assume?
      Last edited by jmflukeiii; 01-24-2012, 02:23 PM.

      Comment


        #4
        Are you the author of the script you posted? The newer approach is more efficient and is what we support for version 7.

        Yes, Rising() and Falling() will compare a current bars value to its previous bars value. What you should take out of the sample is that you can conditionally assign PlotColors property, which allows you to separate setting the indicator plot value from the coloring logic for it.
        Last edited by NinjaTrader_RyanM1; 01-24-2012, 02:30 PM.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          2nd Attempt

          So here's my attempt to do it the new way..... the one trix line doesn't even change colors and the other one changes colors very late.

          Okay I fixed the fast line by changing the PLotcolors to 0 and 0, not sure what to do about the other line that doesn't change colors at all

          EDIT 2: Nevermind, fixed it. I didn't know what the two numbers in brackets were linked to (after the PlotColors), but got it now.
          Attached Files
          Last edited by jmflukeiii; 01-24-2012, 02:42 PM.

          Comment


            #6
            Yes I am the author... I mean I got the equation for trix from the standard ninja indicator, but then I wrote this mess.... I'm fairly new at all this so I don't really know a whole lot.

            Edit: I attached the final version in case anyone has use for it.
            Attached Files
            Last edited by jmflukeiii; 01-24-2012, 02:45 PM.

            Comment


              #7
              OK, great you were able to sort it out using the new approach. Thanks for sharing the final result here.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                No problem, thanks for the help.

                The guy who gave me the idea for the indicator shared his system which works incredibly well for free to everybody so I guess its my tiny tiny way of trying to give a little back as well. I just can't stand MT4 graphics quality (not to mention everything else that sucks about it), plus I wanted to try the system on some other futures instruments.
                Attached Files

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                7 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                18 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                1 view
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                9 views
                0 likes
                Last Post Javierw.ok  
                Started by timmbbo, Today, 08:59 AM
                2 responses
                10 views
                0 likes
                Last Post bltdavid  
                Working...
                X