Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

About Net change

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

    #31
    Thank you for your reply.

    Why is this code in the switch?
    My apologies.
    I had misidentified where the Print(myLastClosePrice); statement should be placed.​

    When I changed where the code should be placed, it showed up in real time in NinjaScript Output and Market Analyzer for the AUDUSD symbol, but not for the Tokyo Stock Exchange symbol.
    How can I display the Tokyo Stock Exchange symbols as well?​
    Attached Files

    Comment


      #32
      Hello ラリー,

      The sample code I provided you saves the time at 9:00 AM. Is there are bar closing at 9:00 AM?

      Your code will need to be coded for the time at which you want to save this close price.

      If you want to know why the condition is not evaluating as true, print the time of the bar and all values used in the condition to the output window.
      Below is a link to a forum post on how to use Print() to debug and understand behavior.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #33
        Thank you for your reply.

        The sample code I provided you saves the time at 9:00 AM. Is there are bar closing at 9:00 AM?

        I don't seem to have a bar that ends at 9:00.

        When I changed it from 9:00 to 15:00, it seems to be real time, but in MyNetChangeModifled, the % display is different from the TWS display, and when I add Netchange to the Market Analyzer and display it, it shows the same % as the TWS.
        However, assuming that MyNetChangeModifled also displays the same % as TWS, I would like to continue to display the closing price of the day until 8:00 am the next day, which is what we initially discussed.

        Also, I took a video.​

        Comment


          #34
          Hello ラリー,

          You can set the price you want to use for the last close price at any time you want if there is a bar updating.

          I would not be able to comment on matching the code of another platform.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #35
            Thank you for your reply.

            You can set the price you want to use for the last close price at any time you want if there is a bar updating.
            I sent you a video yesterday during the opening of the Tokyo Stock Exchange, and the closing price of 3903 closed at 971 yen, which is 8.73% in %, but the Last Price in the Market Analyzer still shows the numbers.
            However, the % is reset (probably on the next day).
            How can I display the % of the previous day's closing price until 8:00 a.m. JST (Japan Standard Time) the next day?​
            Attached Files

            Comment


              #36
              Hello ラリー,

              Print the values.

              Are you using myLastClosePrice is the Percent calculation?

              What is the value of myLastClosePrice before its used in the calculation? What is current price?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #37
                Thank you for your reply.

                Print the values.
                I didn't know where to describe where to add the prints, which line should I do the prints on?


                Are you using myLastClosePrice is the Percent calculation?
                No, I am using NinjaScript default Last Price.

                What is the value of myLastClosePrice before its used in the calculation? What is current price?

                Last Close is also using the default and the price is shown as 971 yen close as attached.
                Also, the current price was referring to the Last Price.​
                Attached Files
                Last edited by ラリー; 09-29-2022, 05:14 PM.

                Comment


                  #38
                  Hello ラリー,

                  It appears you are making a new script.

                  Have you already added a plot to finish your indicator so this displays a value in the market analyzer?

                  In your new script, you will need to enable IsDataSeriesRequired, add a variable, and set the variable in OnBarUpdate() at the specific time you want, just like the indicator.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #39
                    Have you already added a plot to finish your indicator so this displays a value in the market analyzer?
                    Thank you for your reply.

                    Are you referring to the latest screenshot I sent you?
                    In that case, I have not added the plot yet.

                    In your new script, you will need to enable IsDataSeriesRequired, add a variable, and set the variable in OnBarUpdate() at the specific time you want, just like the indicator.
                    https://ninjatrader.com/support/help...esrequired.htm
                    Am I correct in understanding that if I do so, it will be displayed until 8:00 a.m. Japan time the next day?
                    Last edited by ラリー; 09-30-2022, 08:49 PM.

                    Comment


                      #40
                      Hello ラリー,

                      I am referring to the indicator you were previously creating, before you created a market analyzer column script.

                      Am I correct in understanding that if I do so, it will be displayed until 8:00 a.m. Japan time the next day?
                      Whatever DateTime you save to a variable, is the date and time saved to that variable. If you want to display the date and time, you can set the CurrentText in the market analyzer column. If you want to show the price, do as you did in the indicator you created, or just use that indicator and set the plot in that indicator so it can be read in the Market Analyzer.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #41
                        Thank you for your reply.

                        You mentioned the MyNetChangeModifiedNinjaScript file.
                        You mentioned the MyNetChangeModifiedNinjaScript file.
                        Again, I had not yet added the plot, so I added the plot to line 44 in the NinjaScript file and ran it, but there seems to be no change in the market analyzer.

                        Whatever DateTime you save to a variable, is the date and time saved to that variable. If you want to display the date and time, you can set the CurrentText in the market analyzer column. If you want to show the price, do as you did in the indicator you created, or just use that indicator and set the plot in that indicator so it can be read in the Market Analyzer.
                        There may have been a problem in the way I communicated this.

                        I think that the Netchange (percent), which is provided by default in NinjaScript from the beginning, resets after a certain period of time, but I just want to keep it displayed without resetting until 8:00 JST (Japan Standard Time) the next day.​
                        Attached Files

                        Comment


                          #42
                          Hello ラリー,

                          There are 3 parts to adding the plot.
                          1. AddPlot() in State.SetDefaults
                          2. A public Series<double> to return the Value series of that plot index
                          3. The Value being set in OnBarUpdate()
                          May I confirm you have all 3 parts as demonstrated in the forum post where I have sample code showing all 3 parts?
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #43
                            Thank you for your reply.

                            May I confirm you have all 3 parts as demonstrated in the forum post where I have sample code showing all 3 parts?

                            I have added the plot only on line 44, as you can see in the latest screenshot.
                            You also mentioned that you need to add 3 more plots, could you please provide a screenshot if possible?​

                            Comment


                              #44
                              Hello ラリー,

                              I am not directing you to add 3 plots. I am directing you to add the plot, return the series with a public property, and set the plot value.

                              There are 3 components of setting a single plot.

                              Adding the plot with AddPlot() generates a Series<double> object in the Values collection. This has to be publicly returned to be available to the Market Analyzer or Strategy Builder.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #45
                                Thank you for your reply.

                                I am not directing you to add 3 plots. I am directing you to add the plot, return the series with a public property, and set the plot value.
                                Are you referring to this setting?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by trilliantrader, 04-10-2024, 09:33 PM
                                7 responses
                                25 views
                                0 likes
                                Last Post NinjaTrader_BrandonH  
                                Started by traderqz, Today, 12:06 AM
                                5 responses
                                11 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Started by Mongo, Today, 11:05 AM
                                2 responses
                                10 views
                                0 likes
                                Last Post Mongo
                                by Mongo
                                 
                                Started by guillembm, Today, 11:25 AM
                                0 responses
                                5 views
                                0 likes
                                Last Post guillembm  
                                Started by Tim-c, Today, 10:58 AM
                                1 response
                                3 views
                                0 likes
                                Last Post NinjaTrader_Jesse  
                                Working...
                                X