Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Take existing Indicator and ADD a function to it

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

    Take existing Indicator and ADD a function to it

    I would like to take NTSvePIVOTS copy it and tell it to change color (from blue to red & from red to blue) when two price bar closes occur above it or below it.

    Can I have someone with patients walk me thru the programing process?

    #2
    Hello trdninstyle, thanks for writing in.

    This indicator has many plots, I made an example that changes the "Pp" plot color based on the condition:

    if(Close[0] < pp && Close[1] < pp)
    {
    Print("Changing PlotBrushes for Red");
    PlotBrushes[0][0] = Brushes.Red;
    }

    if(Close[0] > pp && Close[1] > pp)
    {
    PlotBrushes[0][0] = Brushes.Blue;
    }

    I attached my test script for you to test as well.

    Here is documentation on the PlotBrushes array:
    https://ninjatrader.com/support/help...lotbrushes.htm

    Please let me know if you have any questions about this material.
    Attached Files

    Comment


      #3
      Hello Chris L,

      Hey that code looks good it would take me a year to learn. I did learn some basics when I dove into writing the code for changing the background color as trigger lines cross I'm still using it.

      Okay now you're going to find out why I needed someone w/ patients because I am very ill-equipped with most of this stuff.

      That attached file you have for me NTSvePivots.cs (27.0 KB, 0 views) I opened it then click 'save as' I then saved it to my desktop but as I go thru my control center > Tools > Import > Ninja script Ad On < I don't see it on my desktop but I do see it not going thru Control Center.

      When I first opened it I selected the 'e' as in internet and I gave it the prompt to always open it that way and that might be why? Basically I've been messing with it now for 30 minutes maybe more. So you wrote a sample for me to look at? As a way to import it to my chart to take a look at? The way it reads it sounds like the Pp will change color 2 closes above the pivot.. Blur or Red per direction.

      Thank you for that. But I can't get onto 1st base to look.
      Last edited by trdninstyle; 12-11-2020, 06:56 PM.

      Comment


        #4
        The NTSvePIVOTS has one pivot & the other lines are S1M S1 S2M & so forth same for resistance.

        I took the Fibonacci Pivot Indicator instead and used the same 'user defined Values' of H L C and it's EXACTLY as the NTSvePIVOTS Indicator.

        It most likely would be easier to use that one. What I'm going after is to have all of the lines turn their perspective colors as price closes above & below. Would it be less coding using a regular Pivot Indicator like the Fib Pivot? Or just Pivot Indicator.

        Well looking more at the NTSvePIVOTS there are more pivot levels which is beneficial for those higher volume days I would rather work on that coding for this one because I'll have it for longer term & once it's mine I have it. I'd rather pull my hair out working on the NTSvePIVOTS.
        Last edited by trdninstyle; 12-11-2020, 07:48 PM.

        Comment


          #5
          Originally posted by trdninstyle View Post
          Hello Chris L,

          Hey that code looks good it would take me a year to learn. I did learn some basics when I dove into writing the code for changing the background color as trigger lines cross I'm still using it.

          Okay now you're going to find out why I needed someone w/ patients because I am very ill-equipped with most of this stuff.

          That attached file you have for me NTSvePivots.cs (27.0 KB, 0 views) I opened it then click 'save as' I then saved it to my desktop but as I go thru my control center > Tools > Import > Ninja script Ad On < I don't see it on my desktop but I do see it not going thru Control Center.

          When I first opened it I selected the 'e' as in internet and I gave it the prompt to always open it that way and that might be why? Basically I've been messing with it now for 30 minutes maybe more. So you wrote a sample for me to look at? As a way to import it to my chart to take a look at? The way it reads it sounds like the Pp will change color 2 closes above the pivot.. Blur or Red per direction.

          Thank you for that. But I can't get onto 1st base to look.
          Hello trdninstyle,
          When you save as NTSvePivots.cs & make required changes then compile, it will be .cs so you need to export it first as .zip & then you can import it when required.
          Basically, you should use NTSvePivots if you need historical pivots otherwise standard Pivots / Fibonacci Pivots are good to go and you will find working with them comparatively easier.
          Hope it helps!

          Comment


            #6
            Originally posted by s.kinra View Post

            Hello trdninstyle,
            When you save as NTSvePivots.cs & make required changes then compile, it will be .cs so you need to export it first as .zip & then you can import it when required.
            Basically, you should use NTSvePivots if you need historical pivots otherwise standard Pivots / Fibonacci Pivots are good to go and you will find working with them comparatively easier.
            Hope it helps!
            Thankyou s.kinra for responding.

            I did remember that I had to export to a .zip file then my control center gave me a warning that script archive was made from a older, incompatible version of NinjaTrader.

            What I meant by being easier w/ the standard pivot pt indicator was less steps in changing the code for every pivot line there's 14 area's of s/r and only 7 on a standard pivot point ind. Many times price reaches those outer boundaries of S/R.



            The nxt 2 paragraphs is for anyone out there searching to learn more about trading: Alan Farley Master swing trader Ch. 6

            Although I usually update the closing # at 12 Noon and only add the further away H & L usually one of the H or L will be breached. This give's u a current realistic S/R level's.

            *Markets do respond to the new update at Noon. That's bc noon is one of the 'Market Clock's' increments where price is being settled from the prev. time slot of 9:00am - 10:30am the 9 to10:30 settles the overnight trading from 4:30pm to 9:00am nxt day. These increments are 90 m's apart except for overnight if u identify these times u will began to see a pattern of either a carryover or a trend ending & the proceeding time slot will set up the nxt time slot.
            Attached Files

            Comment


              #7
              Hello trdninstyle,
              I don't see any such version issues with 8.0.23.1 64-bit, so you can import the original NTSvePivots & then make further changes. Just in case you wish to use .cs file shared by Chris, you can simply copy this file to Documents\NinjaTrader 8\bin\Custom\Indicators then go to control center -> NinjaScript Editor & compile (F5).
              Thanks for sharing your concept.

              Comment


                #8
                Hey again s.kinra,

                (copy this file to Documents\NinjaTrader 8\bin\Custom\Indicators then go to control center) I tried to do this part what can I say I don't know what I'm doing. I tried this & that and a little bit of what u told me and it's just to look at a script to see if thats what I'm wanting the indicator to do. I'm sure Chris had the idea I'll trust him. If u want to since u know how to download it on your charts take a screenshot of the indicator and post it here? Once I see it I can say "Yes thats it" If u do just make sure we can see price action passing up or down thru the Pp line and it should change color from Red to Blue or visa versa. u could just squeeze up ur chart a little & in just a glance I'll know.

                Just for Chris's example purposes he just adjusted the Pp part not all of the lines, of course not. Please if want to and thankyou anyway for all of your time.

                Comment


                  #9
                  I went into ( https://ninjatrader.com/support/help...lotbrushes.htm ) copied/paste that example into NinjaScriptEditor for new indicator the only problem I'm seeing is Line 142 & I can't figure out what it's telling me to do? I tried different things ?

                  Thought I would get familiar by using the example's.
                  Attached Files

                  Comment


                    #10
                    You can actually delete the bracket in line 143 & you're good to go, let me share a snapshot of NTSvePivots on my chart. This is the original one, I'll share the one done by Chris in a while so you have better clarity.
                    Click image for larger version  Name:	NTSvePivots.jpg Views:	0 Size:	230.8 KB ID:	1132121Click image for larger version  Name:	NTSvePivots1.jpg Views:	0 Size:	89.4 KB ID:	1132120
                    Last edited by s.kinra; 12-13-2020, 09:27 PM.

                    Comment


                      #11
                      OK, here you can see the one done by Chris. I've changed the color of pp here (gold) so you can see the difference (blue & red).
                      Click image for larger version

Name:	NTSvePivots.jpg
Views:	434
Size:	78.7 KB
ID:	1132126Click image for larger version

Name:	NTSvePivots1.jpg
Views:	459
Size:	15.5 KB
ID:	1132125

                      Comment


                        #12
                        Also note that in order to see the changes done by Chris on your chart you must ensure Show Historical Pivots is checked (or true) because then only the pp will actually be plotted otherwise its a rendered line so you will not notice any color changes done by code. I modified the width of pp plot so its even more clear to you, attached snapshot.
                        Click image for larger version

Name:	NTSvePivots.jpg
Views:	464
Size:	37.9 KB
ID:	1132128
                        Last edited by s.kinra; 12-13-2020, 09:42 PM. Reason: attached snapshot

                        Comment


                          #13
                          Let me also share the zip file of NTSvePivots as done by Chris so you don't face issues while importing. You can simply import this on your charts.
                          NTSvePivots-Indicator-NT8.zip

                          Comment


                            #14
                            Thankyou for working on my stuff s.kinra,

                            (On #10) I'll delete Line 143 in a little while. Line 143 will take care of line 142 then.

                            (# 11 & #12) Yes that looks real good thats exactly what I'm after. Thankyou for posting those pics I do appreciate your work.

                            (#13) From the other times I imported the indicator it's causing issues now. I deleted all the other downloads restarted my computer but it's still telling me i got issues. But if I clear out my cache in NT8 would that matter? I should anyway.
                            Attached Files

                            Comment


                              #15
                              You can go to NinjaScript Editor & look for the errors, then only would be able to resolve, clearing cache won't help. You have some other indicator causing the error, hunt for it.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              607 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              353 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              561 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X