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 since Last Week's Close

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

    Net Change since Last Week's Close

    Hi,

    I'm trying to get the Net change since Last week's close.

    Isn't that:

    (Close[0] - Close[0].DayOfWeek.Friday);

    ???

    #2
    Hello stockgoblin,
    If you are trying to calcualate the differene on Intraday bars then you may consider using this code to calculate the Weekly OHLC.


    A sample code to calculate the difference will be like:
    Code:
    double diff = PriorWeekOHLC().PriorWeekClose[0] - Close[0];
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hey, Thanks for pointing me in the direction of your indicator. I'm looking for the Prior Week's Close to put on the Market Analyzer. I tried your indicator but it just gives me the prior days close in the Market Analyzer. Did you expand that code for use in the Market Analyzer?

      Can I do a simple modification to make it give me the Prior Week's Close in the Market Analyzer?

      Comment


        #4
        Hello stockgoblin,
        To assists you further can I know what parameters you have used while assigning the Indicator in the Market Analyzer.

        Can you please upload a screenshot of the indicator parameters box.

        To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

        For detailed instructions please visit the following link
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I tried using daily data and that's when you get the previous day's close. Using weekly data in the market analyzer settings gives numbers that I can't verify where they come from.
          Attached Files

          Comment


            #6
            Hello stockgoblin,
            Thanks for the clarification.

            The PriorWeekOHLC indicator works on Intraday Data only.

            To view the prior weeks closing price on the Market Analyzer you can simply use a 1 (one) period SMA applied on weekly data with Calculate on bar close set to true. Please refer to the attached screenshot which further demonstrates the scenario.
            Attached Files
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Now, that's smart thinking.

              Can I press your brain further though? Now that I have the Prior Week's close, I would like the net change from the prior week's close on the Market Analyzer.

              so:

              Can we do that in a formula using SMA and I'll whip up a market analyzer indicator?

              Comment


                #8
                Hello stockgoblin,
                The prior week indicator works on intraday data only.

                A much easier way would be simply calculate a net change indicator and apply it on a weekly bar.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Yea, that sounds good. I'll get on it. There is a Net Change Market Analyzer indicator but it's hard coded for the last daily close, not the last weekly close.

                  Comment


                    #10
                    Hello stockgoblin,
                    The NetChange is a MarketAnalyzer column and not an indicator.

                    You have to build an custom indicator to calculate the net change and then apply the indicator on a weekly bar with Calculate on bar close set to false.
                    JoydeepNinjaTrader Customer Service

                    Comment


                      #11
                      Done! Thanks for all your help.
                      Attached Files

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by adeelshahzad, Today, 03:54 AM
                      4 responses
                      25 views
                      0 likes
                      Last Post adeelshahzad  
                      Started by merzo, 06-25-2023, 02:19 AM
                      10 responses
                      823 views
                      1 like
                      Last Post NinjaTrader_ChristopherJ  
                      Started by frankthearm, Today, 09:08 AM
                      5 responses
                      17 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Started by jeronymite, 04-12-2024, 04:26 PM
                      3 responses
                      43 views
                      0 likes
                      Last Post jeronymite  
                      Started by yertle, Today, 08:38 AM
                      5 responses
                      16 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Working...
                      X