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

Slope function output

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

    #31
    Originally posted by Burga1 View Post
    Gumphrie can you please explain a lil bit on how to utilize that code you posted earlier on "overriding" the Plot Class?? Thank you.
    Hi Burga,

    The Plot class is the lower level method to OnBarUpdate which lets you directly manipulate the graphics used to draw stuff on the chart. So in this example I used it to draw a box to put the degree values in, which wouldn't normally be possible just using the NinjaScript Draw functions.

    Comment


      #32
      Hi,

      Thank you for your reply. So the code you did should be included within the "OnBarUpdate" function, or elsewhere?

      Comment


        #33
        Hi again Gumphrie,

        OK I think I figured out how to construct the indicator...I just have a couple of questions about your code please. In the code you wrote "do something" where I assume code is inserted after the degree angle has been determined, correct?

        Also you have "populated in OnBarUpdate" for the "EMASeries" variable, I assume that the values for "EMASeries" is to be calculated there...?

        Comment


          #34
          Gumphrie,
          I like your MaSlopeBox...just what I was looking for. Could you please provide a quick response as to how I would tweak it to plot the actual "degrees" values, say for the SMA WYS, instead of the price SMA itself. If I can plot the degrees DataSeries, then I can use the values in subsequent logic. Thanks for yor help.
          Don44

          Comment


            #35
            I'd really like to be able to use this indicator, but it doesn't seem to do anything.

            No value is every shown in the data box and plot is always empty.

            Am I doing something wrong?

            It looks like the last version was quite a while ago so perhaps it needs a few tweaks to work with 6.5.

            Comment


              #36
              Your suspicion is most likely correct. Please see if there are any errors in the Control Center logs tab when running this indicator for a clue as to the culprit.
              Josh P.NinjaTrader Customer Service

              Comment


                #37
                6.5 version

                Find attached, NT changed their implementation of the Slope() function with 6.5.
                Attached Files

                Comment


                  #38
                  Thank you very much. This is SO useful.

                  I'm still getting the hang of it, but I'm wondering if there is a way to display the slope in the Databox? Currently it shows the moving average value, rather than the slope.

                  Currently the only indication of slope is a small box in the bottom right corner and it seems many indicators (BarTimer, CandleStickPattern, etc) like to use this exact spot which can make the result difficult to see. I'd like to use this indicator for multiple EMAs at once , but the degrees display overlaps itself...
                  Last edited by Elliott Wave; 04-13-2008, 10:13 PM.

                  Comment


                    #39
                    I changed this so you can use multiple instances without having the data boxes covering each other up.

                    Just change the boxnumber parameter.

                    This may conflict with previous versions due to the public enums, if so simply open the .cs file in notepad and comment that code and it should work.
                    Last edited by Elliott Wave; 04-16-2008, 01:13 AM.

                    Comment


                      #40
                      Originally posted by Gumphrie View Post
                      Find attached, NT changed their implementation of the Slope() function with 6.5.
                      This is such an awesome indicator I decided to 'enhance' it as part of my NinjaScript learning experience.

                      Feel free to optimize anything that could be done better. My main goal was to allow multiple instances, increase the number of MA types supported, enhance readability with higher resolutions, and prevent the data box from conflicting with every other indicator that likes to use that same spot on the chart.

                      Comment


                        #41
                        This is a really interesting indicator, many thanks to Gumphrie & Elliot Wave for putting it together, presumably it's being used to try and determine if market is range bound or trending (maybe with a couple of different MAs e.g. fast and slow)?

                        Has anyone nailed down anything more than that (period,type, slope etc) or have some initial values to look at?

                        Comment


                          #42
                          I'm still experimenting, but I think you have the idea. Basically its to avoid trading false signals when the market is directionless.

                          At the moment I'm using 5 different periods. I like to use EMAs and the WDS slope as its independent of the chart view. A way to use it that often identifies good trades is that when all 5 periods are negative (a long downtrend), then the shortest three turn positive I will go long (a confirmed reversal). Another example is to go short when all 5 period are negative (definitely not a false trend), and then cover when the shortest period turn positive above 80 degrees (a sharp reversal).

                          Another benefit would be as a quick way to get out of bad trades. For example if you are short and the 5 period EMA slope suddenly goes to +70 degrees, it might be time to bail... Looking at historically bad trades in my strategy, this could be a good filter to keep the losses as small as possible, rather than waiting for slower reacting conditions to exit the trade.


                          There's countless ways this could be used, but until the slope output is accessible externally to the strategy wizard and as the input of other indicators, its not as powerful as it could be.

                          If the degrees calculation is made into a plot, it could also be used in the market analyzer.

                          I'm still scratching my head on how to do it though. I'll have to look at a few more examples and work on it tonight.
                          Last edited by Elliott Wave; 04-17-2008, 02:32 PM.

                          Comment


                            #43
                            These all seem like good ideas. You're right - if the degree output could be used within strategies then it could have a number of potential uses as an indicator. I'd love to help, but that's way above my programming level at the moment.

                            Are you aware of some of the TRO indicators Josh ported over? TRO_PMSM_Trend would give you an alternative way of showing trend direction of multiple MAs that you could reference in a strategy. http://www.ninjatrader-support.com/v...ead.php?t=2671

                            However, having the degree of the slope could be much more powerful.

                            Comment


                              #44
                              Awesome indicator. Is there a way to change the font color so the number doesn't clash with the background?

                              Comment


                                #45
                                Paul, thats something I'd eventually like to make a parameter that can be changed but at the moment, you'll have to edit the code.

                                I made the font a bit bigger than the original because I'm using a high resolution.

                                In the code under variables this line sets the default font:
                                private System.Drawing.Font textFont = new Font("Arial", 12);

                                To change the colors of the font from lime and red, use the search and replace function and search for

                                Color.Red and Color.LimeGreen and replace all instances with whatever colors your prefer.

                                -----

                                Originally posted by altrader View Post
                                These all seem like good ideas. You're right - if the degree output could be used within strategies then it could have a number of potential uses as an indicator. I'd love to help, but that's way above my programming level at the moment.

                                Are you aware of some of the TRO indicators Josh ported over? TRO_PMSM_Trend would give you an alternative way of showing trend direction of multiple MAs that you could reference in a strategy. http://www.ninjatrader-support.com/v...ead.php?t=2671
                                Above my level too, but I'll see if I can figure it out. Those indicators looks interesting, but it appears they aren't 6.5 compatible yet.

                                I'm really excited for NT7 when hopefully the "InputSeries" parameter is supported from the indicator dialog on the charts. Currently it appears you have to plot an indicator as part of a strategy to be able to set the input of the indicator to the output of other indicators.

                                Being able to measure the slope of any indicator value would be really useful.
                                Last edited by Elliott Wave; 04-17-2008, 04:07 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by sidlercom80, 10-28-2023, 08:49 AM
                                168 responses
                                2,262 views
                                0 likes
                                Last Post sidlercom80  
                                Started by Barry Milan, Yesterday, 10:35 PM
                                3 responses
                                10 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Started by WeyldFalcon, 12-10-2020, 06:48 PM
                                14 responses
                                1,429 views
                                0 likes
                                Last Post Handclap0241  
                                Started by DJ888, 04-16-2024, 06:09 PM
                                2 responses
                                9 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by jeronymite, 04-12-2024, 04:26 PM
                                3 responses
                                41 views
                                0 likes
                                Last Post jeronymite  
                                Working...
                                X