Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EasyLanguage to NinjaScript

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

    #46
    I was reading around the plotting subject and I found an indicator called SmaRSIV6.cs.

    Looking into it I found:

    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    and
    using NinjaTrader.NinjaScript;
    using NinjaTrader.NinjaScript.DrawingTools;

    none of these are supported in the compiler.

    Also, this was no help with dot drawing.

    Comment


      #47
      Originally posted by RobinT View Post
      OK< I understand.

      Is the a way of detecting the close of in instrument at the close time.
      When the OnBarUpdate() event occurs with CalculateOnBarClose = true, that will be the moment the close occurred. So you could just call Time[0] in OnBarUpdate().
      If you are using CalculateOnBarClose = false, you could use FirstTickOfBar and then TIme[1]. For example: http://ninjatrader.com/support/forum...ad.php?t=19387
      Originally posted by RobinT View Post
      can anyone help me with changing the appearance of the dot object. I can draw a dot but it has a certain style. How do I change the style and size. I am using:

      DrawDot("AMBuy", false, value40, value49, Color.Green ) ;

      I get a green dot with a white border.
      There is no means to change the outline color of the Dot. You may instead wish to use DrawText with WingDings: http://ninjatrader.com/support/forum...ad.php?t=70299

      Please let me know if you have any questions.

      Comment


        #48
        Thanks, investigating.

        I use CalculateOnBarClose = true

        and the problem is i am not getting an OnBarUpdate on the last bar on chart.

        Comment


          #49
          DrawText("Unf1", false, "l", 0, value15, 0, Color.White, new Font("Wingdings", 8),
          StringAlignment.Center, Color.Transparent, Color.White, 0);

          did the trick. Thanks

          Comment


            #50
            Originally posted by RobinT View Post
            Thanks, investigating.

            I use CalculateOnBarClose = true

            and the problem is i am not getting an OnBarUpdate on the last bar on chart.
            The last bar of the chart will not technically close until the opening tick of the next bar and therefore you could not retrieve it by calling Close before the open of the next session.

            Comment


              #51
              so my question remains, How do you ever get the session close on the most recent bar ? How would you ever get daily stock closes ?

              Comment


                #52
                Hello RobinT,

                You could compare the current bar timestamp (using CalculatOnBarClose = false) against the Session End. You can use GetNextBeginEnd to do so: http://ninjatrader.com/support/helpG...xtbeginend.htm

                Comment


                  #53
                  I'll try that.

                  Out of interest I am only using Historical Data. I have got one minute charts from TradeStation and I am using five minute bars.I have tried adding a dummy bar at the end of the data but that didnt work.

                  Comment


                    #54
                    My software only seems to run to the date on the screen. If I scroll to the lastbar then the software runs to completion.

                    Have I got one of the control commands (like overlay = true) set wrongly ?

                    Comment


                      #55
                      Originally posted by RobinT View Post
                      My software only seems to run to the date on the screen. If I scroll to the lastbar then the software runs to completion.

                      Have I got one of the control commands (like overlay = true) set wrongly ?
                      This does occur in NinjaTrader 7. You can increment the bar by pressing the right arrow on your keyboard if you wanted to process bar by bar and analyze for example.

                      Comment


                        #56
                        I'm still trying to get the close value.

                        I have got the time sorted as I use es futures on stream 2 so I can use

                        time = day_close & BarsInProgress == 1

                        as the futures trade for 15 minutes after the close.

                        but the question still remains, how would I get the close value of a stock that closes at the NYSE close. Also, I use closes [0][0] to get the close price but this gives me the close price of the bar 5 minutes earlier.

                        Comment


                          #57
                          if i do closes [1][0] it gives me the close of the correct bar but closes[0][0] gives me the previous bar. these are historical charts.
                          Last edited by RobinT; 02-25-2016, 06:01 PM.

                          Comment


                            #58
                            If I wanted to get the close at a specific time of two charts with different periods, I could do:

                            spx_cls = Close [GetBar ( dt )] ;
                            es_cls = Closes[1][GetBar ( dt )]

                            if I wanted the bars ago count for channel [0] I could do:

                            back = GetBar ( dt ) ;

                            but how would I do it for channel [1]

                            Comment


                              #59
                              I was wrong:

                              es_cls = Closes[1][GetBar ( dt )] ;

                              does not work.

                              with dt = 2/12/2016 9:00:00 PM

                              I get the wrong data for [1] and the correct data for [0].

                              Comment


                                #60
                                is there an order to the BarsInProgress == , ie does 0 always get run first then 1 and so on ?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                607 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                353 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                105 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                560 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                561 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X