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

Net Change and...

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

    Net Change and...

    Hi:

    Could you point me to several good sources for Net Change in NT 7?

    I would like to see parameters that will all one to choose different times to begin calculating the Net Change for the instrument (each would be different).

    Thanks.

    #2
    Hello birdog,

    Thank you for your post.

    You can find such an indicator at the following link: http://www.ninjatrader.com/support/f...d=1&linkid=259

    Comment


      #3
      Hey @PatrickH

      I just tested it on different Bar Types and Time Frames. It seems to show the exact same result on all of them. With a cursory look, it seems nice. Thanks.

      However, in the parameters it reads Previous Close (notes UserDefined). Right now the default is set to "1". I don't really know what that means (i.e "1") for it. So, how would I:

      1. Find out and know what 1 means so that I know where it is calculating the Previous Close from?

      2. How can I change it to calculate from a particular time (i.e say from 2:00 am est, OR 7:00 am est, OR 9:30 am est etc etc etc)?

      3. It appears to show the total tick, pips, or difference from wherever it is calculating the Previous Close from (which I need to figure out where the "from" is) that is good. BUT, how can I make it display in the form of a percentage instead (i.e. % Change)?

      Thanks a lot!



      Originally posted by NinjaTrader_PatrickH View Post
      Hello birdog,

      Thank you for your post.

      You can find such an indicator at the following link: http://www.ninjatrader.com/support/f...d=1&linkid=259

      Comment


        #4
        Hello birdog,

        Thank you for your response.

        The previousClose parameter is used to set a user defined price level as the close. 1 is the default and means 1 on the price scale. You will want to change this to your desired value for the previous close.

        You can edit this indicator to calculate on a DateTime and produce the value in percent. You can use GetBar() to pull the barsAgo for the desired DateTime: http://www.ninjatrader.com/support/h...nt7/getbar.htm

        Please let me know if I may be of further assistance.

        Comment


          #5
          Ok.

          So, how can I have it ignore the Previous close because I would not really want to manually add that every time for different instruments?

          Will this replace that Previous Close:?

          I just would like to have it set automatically in the code to go get the price from a particular time and use that instead. If possible, also, show it as a percentage change rather than a amount change (this would effectively standardize it across any/all instruments).

          Is there any way you could show me some code to do that and/or pop the code in that indicator (if you have a few moments)?

          Thanks again!!!


          You can edit this indicator to calculate on a DateTime and produce the value in percent. You can use GetBar() to pull the barsAgo for the desired DateTime: http://www.ninjatrader.com/support/h...nt7/getbar.htm

          Originally posted by NinjaTrader_PatrickH View Post
          Hello birdog,

          Thank you for your response.

          The previousClose parameter is used to set a user defined price level as the close. 1 is the default and means 1 on the price scale. You will want to change this to your desired value for the previous close.

          You can edit this indicator to calculate on a DateTime and produce the value in percent. You can use GetBar() to pull the barsAgo for the desired DateTime: http://www.ninjatrader.com/support/h...nt7/getbar.htm

          Please let me know if I may be of further assistance.

          Comment


            #6
            Hello bridog,

            Thank you for your response.

            ToTime() will actually work well for this instead of GetBar(). Below is the code using the previousClose to store the value of the Close[0] at 9 AM and then plotting the change as percent:
            Code:
            			if(ToTime(Time[0]) == ToTime(9,0,0))
            				previousClose = Close[0];
            			
            			CustomeNetChange.Set((Close[0]-previousClose)/previousClose);

            Comment


              #7
              Hi PatrickH

              Ok. Where would I put ToTime in this code http://www.ninjatrader.com/support/f...d=1&linkid=259?

              Also, what code and where do I need to put it in http://www.ninjatrader.com/support/f...d=1&linkid=259 to make it GET the last price at, say 4 PM lose Open of the bar at 9:30 AM EST automatically (so it uses the last price at, say, 9:30 AM EST). Or, another example would be to GET the last price, at say, 4 pm EST the during the last trading day (yesterday or Friday if it is currently Monday etc).



              Originally posted by NinjaTrader_PatrickH View Post
              Hello bridog,

              Thank you for your response.

              ToTime() will actually work well for this instead of GetBar(). Below is the code using the previousClose to store the value of the Close[0] at 9 AM and then plotting the change as percent:
              Code:
              			if(ToTime(Time[0]) == ToTime(9,0,0))
              				previousClose = Close[0];
              			
              			CustomeNetChange.Set((Close[0]-previousClose)/previousClose);

              Comment


                #8
                Hello birdog,

                Thank you for your response.

                I have attached the indicator adjusted to show the net change in percent form both 9:30 and 4 PM. Please review for the proper placements of the ToTime() and what is necessary to capture and plot these values.
                Attached Files

                Comment


                  #9
                  Hey @PatrickH

                  Can we make it:

                  1. Stamp the bottom left corner of the chart with the date and time and price that it is calculating the Net Change from?

                  2. Create a vertical red line at the point the Net Change is calculated from?

                  3. Make the percentages only show 2 decimal spots to the right (i.e 0.53 or 1.63 etc)? Right now, I believe, it is showing (for example) 0.000534 or 1.542321 etc.

                  Thanks so much PatrickH! That should do it I think.



                  Originally posted by NinjaTrader_PatrickH View Post
                  Hello birdog,

                  Thank you for your response.

                  I have attached the indicator adjusted to show the net change in percent form both 9:30 and 4 PM. Please review for the proper placements of the ToTime() and what is necessary to capture and plot these values.

                  Comment


                    #10
                    Hello birdog,

                    Thank you for your response.

                    1. You would use DrawTextFixed(): http://www.ninjatrader.com/support/h...wtextfixed.htm

                    2. You would use DrawVerticalLine(): http://www.ninjatrader.com/support/h...rticalline.htm

                    3. You would need to format the ToString(): http://msdn.microsoft.com/en-us/libr...#FormatStrings

                    If you have limited time or programming capabilities, you can discuss your requirements with any of our certified NinjaScript consultants.
                    Click here for a list of certified NinjaScript Consultants: http://www.ninjatrader.com/Ecosystem/NonBroker.php#81

                    Please let me know if you have any questions.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Aviram Y, Today, 05:29 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post Aviram Y  
                    Started by quantismo, 04-17-2024, 05:13 PM
                    3 responses
                    25 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by ScottWalsh, 04-16-2024, 04:29 PM
                    7 responses
                    34 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by cls71, Today, 04:45 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post cls71
                    by cls71
                     
                    Started by mjairg, 07-20-2023, 11:57 PM
                    3 responses
                    218 views
                    1 like
                    Last Post PaulMohn  
                    Working...
                    X