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

Print()

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

    #16
    For example. When I create own simple indicator - in Data Box it's value is 0.00, but should be 0.0000. I can't understand, because built-in ATR or SMA indicators displayed 0.0000 or more numbers after separator (freely).

    Comment


      #17
      1) You would need to DrawLine() from the current bar to one bar ago:

      Code:
      DrawLine("tag0", 0, Close[0], 1, Close[0], Color.Blue);
      Make sure you have enough bars in your DataSeries to plot this correctly: http://www.ninjatrader.com/support/f...ead.php?t=3170

      2) Please review our Help Guide article on Formatting Numbers for more information on this topic:

      MatthewNinjaTrader Product Management

      Comment


        #18
        Dear Matthew, this draw object only in last action. It will be great if I can use it on BackTesting. So, how to do this will be drawn in every action in history?

        Comment


          #19
          Hello,

          You will need to assign a unique tag to each object:

          Code:
          DrawLine("tag0" [B]+ CurrentBar[/B], 0, Close[0], 1, Close[0], Color.Blue);
          MatthewNinjaTrader Product Management

          Comment


            #20
            Wow! Cool! Thanks!

            Comment


              #21
              In Data Box could be values only from indicators?

              Comment


                #22
                The DataBox will display any public plots or data series.

                It is possible to expose values that are not plots. Please see our Reference Sample on Exposing indicator values that are not plots:

                MatthewNinjaTrader Product Management

                Comment


                  #23
                  I use Time[0] to define date and time of trade. How I can change this to only date format
                  I have now "01.06.2012 21:00:00", I need only "01.06.2012" without time

                  Comment


                    #24
                    'Time[0].Date' should do it.

                    Comment


                      #25
                      Originally posted by Radical View Post
                      'Time[0].Date' should do it.
                      Oops! I thanked before checking. Now it's looked like "01.06.2012 00:00:00"

                      Comment


                        #26
                        Could be the case with it being a DateTime object returned.

                        You would need DateTime formatting in this case:

                        Learn to use custom date and time format strings to convert DateTime or DateTimeOffset values into text representations, or to parse strings for dates & times.

                        Comment


                          #27
                          This is it
                          Time[0].ToString("dd.MM.yyyy")

                          Comment


                            #28
                            Draw line in some distance of bar's center

                            Hello. In script I draw lines as levels of buy, sell and stop. There are green, red and blue short lines. They are began from current bar center to next bar center. I use this script to analyze history and as adviser in live chart. The problem is with history displaying. Even when I set margin to 0 in chart parameters, it jump to 1. And you can see peaces of next bar levels. So, it's not comfortable.

                            1. Chart shows the level lines, but don't show this bar.
                            2. With any margin Close price marker shows next bar too. I didn't find opportunity to off it in Chart parameters.
                            See screen.
                            How to set some distance from bar center for starting point of the level line. And to show close price marker for bar that I see, not for next bar chart doesn't display. I don't want to see the future
                            Click image for larger version

Name:	level lines - chart margin.PNG
Views:	1
Size:	13.4 KB
ID:	865553
                            Last edited by alexstox; 06-30-2012, 08:02 AM.

                            Comment


                              #29
                              Hello,

                              Thanks for the post.

                              Unfortunately this would take overriding Plot which would add complexity to your code and would require writing your own custom plotting to offset this.

                              If you go to control center->tools->edit ninjascript->indicator->CustomPlotSample you can see an example on how to get started with this but it is 100% not supported unfortunately you would be on your own to get in there and play.

                              -Brett

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by fx.practic, 10-15-2013, 12:53 AM
                              5 responses
                              5,404 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by Shai Samuel, 07-02-2022, 02:46 PM
                              4 responses
                              95 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by DJ888, Yesterday, 10:57 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              159 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Yesterday, 09:29 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post Belfortbucks  
                              Working...
                              X