Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

About Net change

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

    About Net change

    ネットの変化で表示されているアイテムと、変更があったにもかかわらず0.00%しか表示されていないアイ テムに対する解決策はありますか?
    Attached Files

    #2
    Hello ラリー,

    I've translated this with translate.google.com as
    Is there a solution for items showing up in net change and only showing 0.00% even though they have changed?
    The Net change indicator is using the 'Last close' price in the code.

    May I have you add the 'Last close' market analyzer column and take a new screenshot?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply and translation.

      The current market analyzer seems to show 0.00% for everything as shown in the attachment, but is it possible to make it show this until one hour (8:00) before the market starts the next day after the Tokyo Stock Market closes that day?
      Attached Files

      Comment


        #4
        Hello ラリー,

        Please add the Last close market analyzer column.
        • Right-click the Market Analyzer
        • Select Columns
        • Select Last close
        • Click add
        • Click Ok
        • Take a new screenshot

        Regarding changing the time of when price change occurs, this would require custom coding a market analyzer script. Instead of the marketDataUpdate.Instrument.MarketData.LastClose.P rice, which comes directly from the data provider, you could code the script to load a data series, and then save the price at a specific time to a variable, and then calculate the net change from that variable. That would allow you to select a price at any time, instead of the session close.

        Please let me know if you are interested in custom coding a market analyzer script to use the price from a selected time instead of the session close and would like further direction.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you for your reply.

          Regarding changing the time of when price change occurs, this would require custom coding a market analyzer script. Instead of the marketDataUpdate.Instrument.MarketData.LastClose.P rice, which comes directly from the data provider, you could code the script to load a data series, and then save the price at a specific time to a variable, and then calculate the net change from that variable. That would allow you to select a price at any time, instead of the session close.

          Please let me know if you are interested in custom coding a market analyzer script to use the price from a selected time instead of the session close and would like further direction.
          Thank you for your reply.

          I would like to do those with Net Change, is it possible?

          Comment


            #6
            Hello ラリー,

            Please add the Last close market analyzer column and provide a screenshot.
            • Right-click the Market Analyzer
            • Select Columns
            • Select Last close
            • Click add
            • Click Ok
            • Take a new screenshot

            I would like to do those with Net Change, is it possible?
            You would need to make a custom script.

            You can start by making a copy of the NetChange MarketAnalyzerColumn in the NinjaScript Editor.

            Below is a link to a forum post with helpful resources on getting started with C# and NinjaScript.
            https://ninjatrader.com/support/foru...040#post786040

            To make a copy, open the script in the NinjaScript Editor, right-click the code, select Save As, type a new unique name, click OK
            https://youtu.be/H7aDpWoWUQs?t=355&l...We0Nf&index=14

            Set IsDataSeriesRequired.
            https://ninjatrader.com/support/help...esrequired.htm

            Add a private double variable in the scope of the class to hold the price.

            In OnBarUpdate(), add a time condition to trigger an action at a specific time.
            https://ninjatrader.com/support/help...to_limit_t.htm

            For the action set the double variable to the Close[0].

            Substitute this double variable in the logic in place of 'marketDataUpdate.Instrument.MarketData.LastClose. Price'.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you for your reply.

              In OnBarUpdate(), add a time condition to trigger an action at a specific time.
              https://ninjatrader.com/support/help...to_limit_t.htm
              I think there is a Zip folder in this link, do you want to import it?

              I also got an error output.
              Attached Files

              Comment


                #8
                Hello ラリー,

                Yes, the SampleTimeFilter_NT8 reference sample script can be imported. This is a working example that demonstrates how to create time conditions.

                Use this as an educational example to learn about using DateTime objects in conditions.

                To import a NinjaScript into NinjaTrader 8 do the following:
                1. Download the script to your desktop, keep it in the compressed .zip file.
                2. From the Control Center window select Tools -> Import -> NinjaScript...
                3. Click the Desktop icon on the left to navigate to the desktop
                4. Select the downloaded .zip file -> then click Open
                5. NinjaTrader will then confirm if the import has been successful.
                Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.

                Below is a link to the help guide on importing.
                https://ninjatrader.com/support/help...-us/import.htm

                The code can be viewed in the NinjaScript Editor -> Strategies -> SampleTimeFilter
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you for your reply.

                  I have imported the SampleTimeFilter and used the double variable instead of Price in the NetChange Script Editor, but it outputs an error.
                  I may not understand much about Ninjascript etc.
                  Thank you in advance for your help and guidance.
                  Attached Files

                  Comment


                    #10
                    Thank you for your help.

                    If you have responded to my post, I would appreciate it if you could send it to me again, as I seem to be having some problems with my e-mails, notifications (not getting notifications, etc.) and other issues since the maintenance (NinjaTreder).​

                    Comment


                      #11
                      Hello ラリー,

                      and used the double variable instead of Price in the NetChange Script Editor
                      No, that is not what you have done here. You have just added the word double to the end of marketUpdate.Instrument.MarketData.LastClose. The LastClose is a double. It does not have a sub property with the name double. It already is a double.

                      Below I am providing a link to a forum post with helpful resources on getting started with C# and NinjaScript.
                      https://ninjatrader.com/support/foru...040#post786040

                      A variable holds a value.

                      private double myVariable;

                      This variable has been declared with the type double and the name is myVariable.

                      myVariable = 5.1;

                      Now the variable has been assigned a double value of 5.1. Referring to the myVariable variable will return 5.1.

                      Print("myVariable has a value of " + myVariable);

                      In the output this would print 'myVariable has a value of 5.1'.

                      If wanted to use this variable in that line of code:
                      Code:
                      case Cbi.PerformanceUnit.Percent:  CurrentValue = (marketDataUpdate.Price - myVariable) / myVariable
                      Below is a publicly available link to a 3rd party educational site on variables.
                      https://www.w3schools.com/cs/cs_variables.php
                      Last edited by NinjaTrader_ChelseaB; 09-15-2022, 07:05 AM.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Thank you very much.

                        I will attempt it and will contact you again with the progress.
                        Thank you in advance.​

                        Comment


                          #13
                          I am contacting you to let you know of our progress.

                          I could not find the code description of the private double myVariable in either of the ninja scripts (Netchange, SampleTimeFilter), which one is it?

                          Also, in your post at #6, you said "To keep the price, add a private double variable to the scope of the class" and "In OnBarUpdate(), add a time condition that triggers the action at a specific time". Is it correct to add this to line 33 in the attached image?
                          Also, in OnBarUpdate(), to add a time condition that triggers the action at a specific time, is it correct to leave a space at line 57 of the SampleTimeFilter script and add it there?

                          Thank you in advance for your time.​

                          Attached Files

                          Comment


                            #14
                            Hello ラリー,

                            I was attempting to show you have to use a variable.

                            You will need to declare your own variable. It can have your custom name that you name it.

                            Assign the variable your calculated price.

                            Use the variable in place of the LastClose property being used now.

                            Yes, in your screenshot line 33 would be within the scope of the class and a good place to define variables.

                            No, line 57 is in the scope of the class and is not a place for logic.
                            Last edited by NinjaTrader_ChelseaB; 09-21-2022, 12:42 PM.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Thank you for your reply.

                              I apologize for my lack of understanding and for any inconvenience this may cause, so if possible, could you please attach a screenshot?​

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by futureszone, Today, 02:26 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post futureszone  
                              Started by ttodua, Today, 01:39 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post ttodua
                              by ttodua
                               
                              Started by carnitron, Today, 10:45 AM
                              2 responses
                              35 views
                              0 likes
                              Last Post carnitron  
                              Started by dtaylor, Today, 01:13 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post dtaylor
                              by dtaylor
                               
                              Started by advgal, Today, 09:25 AM
                              1 response
                              17 views
                              0 likes
                              Last Post Soup Kitchen Jim  
                              Working...
                              X