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

Prior Day Close at a specific time

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

    Prior Day Close at a specific time

    I have been trying to make an indicator that makes a pivot line at a specific close time from a previous day. I was working off of Ninja Trader Ray's Reference Sample "Calculating the highest high and the lowest low for a specified time range." I got it to do the pivot line at the close of an exact time put it didn't carry it over into the next day. Also, I only want it to go back to the prior day. Is there an easy fix that I can add to the program that Ninja Trader Ray did? His sample is located in the Reference Samples section. I tried to Frankenstein the Prior OHLC indicator with it but to no avail.

    As always your help is greatly appreciated.

    Robert

    #2
    Just persist your calculated out value and set it to the plot whenever you want this value to display.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh. I am an amateur at this so I have no idea what you just said. Any way you can give me an example?

      Thank you.

      Comment


        #4
        Sure. Take a variable and save out the value as calculated in Ray's example. When you have a plot you are setting the value at some point in time. For example you may be doing Plot0.Set(Close[0]);. Just have it set to the variable you stored earlier.

        Plot0.Set(someVariable);
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I will check into that. You are always huge help. Thanks.

          Comment


            #6
            I am still having problems getting this to work. I just need to be able to plot a pivot line starting from 16:15 the previous day's close thru the current day and then do it again each following day. Can you offer some more advice?

            Comment


              #7
              cre8it8,

              To add a line you want to go to your indicator and do Add(new Plot(.....)) in your Initialize() method. If you need an example of the exact syntax here you can open up any other indicator to take a look at how they do it. Then in your OnBarUpdate() all you need to do is Value.Set() and put in the value as you calculated it.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Thanks for trying to help. I can't get it to work. I can get a line from 16:15 on but it deletes at the start of the new day. Then when I tried to get it to carry forward to the next day I just got a line that went from the beginning of the chart to the end over several days. So my solution is to use the Constant Line Indicator and manually put in the number each day. Later I will pay someone to make it automatic. Thanks again for trying to help.

                Comment


                  #9
                  Hi Josh. I tried emailing you privately but it wouldn't let me so this is the only way I know how to get in touch with you.
                  I may have a huge problem. I imported you Adaptive CCI Indicator and then I made a Strategy out of it and now I can not Import or export any Indicators or Strategies and I can not delete any of them or change them. I get the following message when I try to compile your Adaptive CCI. I love the Indicator, it's amazing, but I really need your help so that my system isn't stuck. It is very possible that I screwed it up some how or that it is an easy fix but I tried everything I know, which isn't much.Here is the list of errors

                  the type or namespace name 'Adaptive CCI Plots' could not be found(are you missing a using directive or an assembly reference?)
                  Line 672 colum42
                  Line 681 colum66
                  Line 742 colum52
                  Line 751 colum76
                  Line769 colum52
                  Line 778 colum76

                  Thanks
                  Robert


                  [IMG]file:///C:/DOCUME%7E1/Northup/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG]

                  Comment


                    #10
                    cre8it8,

                    Adaptive CCI is not my indicator. You will want to contact the original author, Gumphrie.

                    Do not compile the indicator. Just go to Tools->Edit NinjaScript->Indicator and delete the Adaptive CCI. If you can't delete the indicator you need to delete the strategy or anywhere else you referenced the indicator first.
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by guillembm, Yesterday, 11:25 AM
                    2 responses
                    9 views
                    0 likes
                    Last Post guillembm  
                    Started by junkone, 04-21-2024, 07:17 AM
                    9 responses
                    68 views
                    0 likes
                    Last Post jeronymite  
                    Started by trilliantrader, 04-18-2024, 08:16 AM
                    4 responses
                    18 views
                    0 likes
                    Last Post trilliantrader  
                    Started by mgco4you, Yesterday, 09:46 PM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by wzgy0920, Yesterday, 09:53 PM
                    0 responses
                    10 views
                    0 likes
                    Last Post wzgy0920  
                    Working...
                    X