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

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.

            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.

                          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.

                              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:
                                [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] StartMinute
                                {
                                [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] { [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] startMinute; }
                                [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] { startMinute = Math.Max([/SIZE][/SIZE][SIZE=2][SIZE=2][SIZE=2][COLOR=red]0[/COLOR][/SIZE][/SIZE][/SIZE][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Verdana], value); }[/FONT]
                                }
                                [/SIZE][/FONT][/SIZE][/FONT]


                                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 maybeimnotrader, Yesterday, 05:46 PM
                                2 responses
                                21 views
                                0 likes
                                Last Post maybeimnotrader  
                                Started by adeelshahzad, Today, 03:54 AM
                                5 responses
                                32 views
                                0 likes
                                Last Post NinjaTrader_BrandonH  
                                Started by stafe, 04-15-2024, 08:34 PM
                                7 responses
                                32 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                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
                                22 views
                                0 likes
                                Last Post NinjaTrader_Clayton  
                                Working...
                                X