Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instead of using "Bars Ago"

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

    #16
    This feature will be included in NinjaTrader 7.

    To contact a NinjaScript consultant please review this list - http://www.ninjatrader.com/webnew/pa...injaScript.htm
    BertrandNinjaTrader Customer Service

    Comment


      #17
      Excellent. You mean both horizontal and sloped lines?
      When is NT 7 coming out?

      Comment


        #18
        NinjaTrader 7 is scheduled for the second quarter of 2009.

        Can you clarify what you are looking for?

        If you have the value of a line, you can submit an order to trigger at that price level. If you need programming help for such a tool I suggest contacting a NinjaScript consultant from the list in my previous post.
        Last edited by NinjaTrader_Bertrand; 02-12-2009, 12:38 PM.
        BertrandNinjaTrader Customer Service

        Comment


          #19
          One more thing. The way NT generates bars is to print at the end of each minute. That means the 9:30 bar for Esignal (which is standard) is the same as the 9:31 bar for NT .
          This is creating even more distortion in 5 min, 10min , 30 min bars.
          Is there any way to have the bars show the same (standard) value as Esig & IB and others?

          Comment


            #20
            Unfortunately not, as NinjaTrader uses the bars closing time to stamp it.

            http://www.ninjatrader-support.com/H...ChartBars.html
            BertrandNinjaTrader Customer Service

            Comment


              #21
              Hello Bertrand,
              The code below which involves calculating "barsAgo" from several points in the chart and draws lines seems to work only for the last coded action.
              Why is it that the first two lines are not drawn and only the last line is ?
              Also How can I eliminate the "DateTime" since I only want the action to be active for the current day and don't want to update/change "DateTime" everyday?

              if (ToTime(Time[0]) == ToTime(9, 46, 0))
              {
              int A = GetBar(new DateTime(2009, 2, 16, 9, 35, 0));
              int B = GetBar(new DateTime(2009, 2, 16, 9, 46, 0));
              DrawLine(
              "My line", A, Open[A], B, Open[B], Color.Green);
              }
              if (ToTime(Time[0]) == ToTime(10, 05, 0))
              {
              int C = GetBar(new DateTime(2009, 2, 16, 9, 46, 0));
              int D = GetBar(new DateTime(2009, 2, 16, 10, 05, 0));
              DrawLine(
              "My line", C, Open[C], D, Open[D], Color.White);
              }
              if (ToTime(Time[0]) == ToTime(10, 16, 0))
              {
              int E = GetBar(new DateTime(2009, 2, 16, 10, 05, 0));
              int F = GetBar(new DateTime(2009, 2, 16, 10, 16, 0));
              DrawLine(
              "My line", E, Open[E], F, Open[F], Color.Yellow);
              }

              Comment


                #22
                Please use a unique tag for every line you want to draw, such as MyLine1, MyLine2....othewise you just modify one line all the time.

                You can use DateTime.Today for todays date, DateTime.Now for the current time.
                BertrandNinjaTrader Customer Service

                Comment


                  #23
                  Since I have to define a specific time of the current day/today , I came up with the codes below but it seems none of them is correct.

                  int A = GetBar(new DateTime.Today(9, 35, 0));

                  or I can say:

                  int A = GetBar(new DateTime.Today + ToTime(9, 35, 0));

                  Comment


                    #24
                    yellowTrader,

                    int A = GetBar(new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 09, 35, 00));
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #25
                      Thank you Bertrand you helped alot.
                      One more thing, Can DateTime.Yesterday be used as well?
                      And Where can I find a list of methods available?

                      Comment


                        #26
                        You can check what is available through the Intellisense. Just type "DateTime." and then press up and down with your arrow keys to see what is there. For more information on DateTime you would want to check MSDN or Google since this is C#.

                        Off the top of my head I do not think there is a .Yesterday.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #27
                          Hi Josh,
                          Regarding the file you sent me by the link below , I have found a few issues with it . I appreciate it if you can tell me how to fix it.
                          http://www.ninjatrader-support2.com/...ead.php?t=8600
                          1- It seems the "EndMinute" & "StartMinute" does not accept a zero number/integer. i.e. 9:00 or 11:00 & etc... It automatically changes it to a "1" .(this means the data for those bars are not considered in the calculations.)
                          2-The lines which are drawn from the high and the low of the range stop at midnight.
                          I need them to extend all the way to the right of the chart. How can I change the codes to get this result?
                          Thanks for the help.

                          Comment


                            #28
                            Hi yellowTrader, sorry the link seems not to be correct, can't access it and have a look.

                            You can check DrawExtendedLine() for lines with infinite end points - http://www.ninjatrader-support.com/H...endedLine.html
                            BertrandNinjaTrader Customer Service

                            Comment


                              #29
                              Sorry about that. Here is the link.
                              http://www.ninjatrader-support2.com/...ead.php?t=8600

                              Comment


                                #30
                                Hi yellowTrader -

                                1. You will need to expand the properties and change the input declarations to accept also 0's...currently the min value is set 1 by default. For example for the input StartMinute change it to
                                Code:
                                publicint StartMinute
                                {
                                get { return startMinute; }
                                set { startMinute = Math.Max(0, value); }
                                }
                                


                                2. You could save the generated High/Low values to a variable and use this then to plot with the DrawLine.

                                BertrandNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Futurestrader00, Yesterday, 06:14 PM
                                1 response
                                16 views
                                0 likes
                                Last Post cincai
                                by cincai
                                 
                                Started by ballston, Today, 06:32 AM
                                0 responses
                                1 view
                                0 likes
                                Last Post ballston  
                                Started by Danila, Today, 04:38 AM
                                2 responses
                                7 views
                                0 likes
                                Last Post Danila
                                by Danila
                                 
                                Started by sinpeople, Today, 04:38 AM
                                0 responses
                                7 views
                                0 likes
                                Last Post sinpeople  
                                Started by kiffgj, Today, 04:23 AM
                                0 responses
                                7 views
                                0 likes
                                Last Post kiffgj
                                by kiffgj
                                 
                                Working...
                                X