Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

About Net change

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

    #46
    Hello ラリー,

    I believe I was confusing a different thread on a similar topic, linked below.
    Thank you for your reply. Yes it is. Thank you very much. It seems to have worked out well for that one. We want to paint on the chart a candle that has achieved at least 5% from the previous day's close or high. The attached screenshot will be from the TradeStation chart, but I think the attached screenshot is


    Originally posted by ã©ãªã¼ View Post
    Thank you for your reply.

    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.

    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.​

    So, you are not wanting to change when the previous close price is set, you just want to get the net change of the day preceding the previous day to the previous day?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #47
      Thank you for your reply.

      I believe I was confusing a different thread on a similar topic, linked below.
      https://ninjatrader.com/support/foru...1217048​
      In that issue, the net change is the same, but in this case, you want to apply a color (coloring on the individual symbol chart has been resolved, while coloring in the market analyzer has not yet been resolved) to the net change that you arbitrarily specify (e.g., 5%).

      So, you are not wanting to change when the previous close price is set, you just want to get the net change of the day preceding the previous day to the previous day?
      Also, for this problem, you want to indicate how much net change there was from the previous day's closing price of the individual symbol to the next day's closing price.


      Also, I forgot to attach a screenshot of my post 45 thing I posted, so I am attaching it.
      ネットの変化で表示されているアイテムと、変更があったにもかかわらず0.00%しか表示されて&#123
      Attached Files

      Comment


        #48
        Hello ラリー,

        The previous day is yesterday. The next day would be today. You want the net change from the previous day (yesterday) to the current price (as the current day would not have ended)?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #49
          Thank you for your reply.

          For example, let's say the AUDUSD Netchange in the attached image posted in post 35 started trading at 0.20 and ended the day at 0.47%.
          I want that displayed 0.47% to remain displayed until the next day (8:00 am, Japan time).
          The same applies to the symbol for Japanese stocks.

          https://ninjatrader.com/support/foru...17#post1217517

          Comment


            #50
            Hello ラリー,

            So you want the net close ending with the previous session close, not the current sessions net close, but the previous one.
            (from the day preceding the previous day (2 session ago) close to the previous day close (1 session ago))
            Chelsea B.NinjaTrader Customer Service

            Comment


              #51
              Thank you for your reply.

              So you want the net close ending with the previous session close, not the current sessions net close, but the previous one.
              (from the day preceding the previous day (2 session ago) close to the previous day close (1 session ago))​
              Yes, we want it to appear until 8:00 JST the next day.

              Comment


                #52
                Hello ラリー,

                That would be complex if you want to sort through historical data to measure the netChange and also update in real-time.

                In historical, there are a few approaches.

                One suggestion, you could use a set of variables to store the current and previous session closes.

                private double secondPreviousSessionClose, previousSessionClose;

                if(Bars.IsLastBarOfSession)
                {
                secondPreviousSessionClose = previousSessionClose;
                previousSessionClose = Close[0];
                return;
                }

                if (ToTime(Time[0]) < 80000 || ToTime(Time[0]) > 150000) // you can replace the 150000 with whatever time the new session starts
                {
                CurrentValue = (previousSessionClose - secondPreviousSessionClose);
                }



                Chelsea B.NinjaTrader Customer Service

                Comment


                  #53
                  Thank you for your reply.

                  I will give it a try, but where should I put it (in the screenshot)?​
                  Attached Files

                  Comment


                    #54
                    Hello ラリー,

                    As this would be processing historical data, this would go in OnBarUpdate().
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #55
                      Thank you for your reply.

                      I have written the following in OnBarUpdate(), but multiple errors were output.
                      What was wrong with my description?​
                      Attached Files

                      Comment


                        #56
                        Hello ラリー,

                        Declaring variables (what you have on line 60), should be within the scope of the class, (after the class opening curly brace on likely line 28).
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #57
                          Thank you for your reply.


                          I replaced the code in the class and ran it, but MyNetChangeModifled only has 3 horizontal dots and no value (Japanese stock symbol).​
                          Attached Files

                          Comment


                            #58
                            Hello ラリー,

                            Use Print() to understand the behavior.

                            Print the time of the bar and all values used in the condition.


                            Provide the output saved to at text file.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #59
                              Thank you for your reply.

                              I added a print and performed the run, but after the zero value was output, the decimal value was output.
                              Attached Files

                              Comment


                                #60
                                Hello ラリー,

                                It is important to add labels and time stamps to your prints.

                                For example:
                                Print(string.Format("{0} | myValue: {1}", Time[0], myValue));

                                Further, focus on one item at a time so that the prints are not confused.

                                If previousSessionClose and secondPreviousSessionClose are both 0, this would mean the condition to set this never evaluated as true.

                                How many days of historical data is being processed?

                                May I have you print the time and the value of both Bars.IsFirstBarOfSession and Bars.IsLastBarOfSession above the condition that sets these variables?
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by fx.practic, 10-15-2013, 12:53 AM
                                5 responses
                                5,404 views
                                0 likes
                                Last Post Bidder
                                by Bidder
                                 
                                Started by Shai Samuel, 07-02-2022, 02:46 PM
                                4 responses
                                95 views
                                0 likes
                                Last Post Bidder
                                by Bidder
                                 
                                Started by DJ888, Yesterday, 10:57 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by MacDad, 02-25-2024, 11:48 PM
                                7 responses
                                159 views
                                0 likes
                                Last Post loganjarosz123  
                                Started by Belfortbucks, Yesterday, 09:29 PM
                                0 responses
                                8 views
                                0 likes
                                Last Post Belfortbucks  
                                Working...
                                X