Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add instrument to chart in STRATEGY Analyzer

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

    #46
    Dot y scale

    When I add Dot to chart, it is y-scaled as main chart. How not to y-scale Dot?

    Comment


      #47
      Is this a DrawDot() or PlotStyle.Dot?
      Cal H.NinjaTrader Customer Service

      Comment


        #48
        Oops, sorry, DrawDot()!

        Comment


          #49
          Yes,

          DrawDot("myDot", false, barsAgo, Y-Value, Color);
          Cal H.NinjaTrader Customer Service

          Comment


            #50
            Why the values of stock instrument and it's derived indicator differs?
            Here is peace of values (with "ind" is indicator)
            Code:
            20130713 Syyind=0.1500 Syy=0.1500
            20130713 Syyind=0.1500 Syy=0.1500
            20130715 [COLOR="Red"]Syyind=0.1700 Syy=0.1500[/COLOR]
            ...................................
            20130718 Syyind=0.1700 Syy=0.1700
            20130718 [COLOR="red"]Syyind=0.1600 Syy=0.1700[/COLOR]
            20130719 Syyind=0.1600 Syy=0.1600
            20130719 Syyind=0.1600 Syy=0.1600
            20130719 [COLOR="red"]Syyind=0.1800 Syy=0.1600[/COLOR]
            20130720 Syyind=0.1800 Syy=0.1800
            20130720 Syyind=0.1800 Syy=0.1800
            20130722 [COLOR="red"]Syyind=0.1700 Syy=0.1800[/COLOR]
            20130723 Syyind=0.1700 Syy=0.1700
            20130723 Syyind=0.1700 Syy=0.1700
            20130723 [COLOR="red"]Syyind=0.1900 Syy=0.1700[/COLOR]
            20130724 Syyind=0.1900 Syy=0.1900
            20130724 Syyind=0.1900 Syy=0.1900
            20130724 [COLOR="red"]Syyind=0.2000 Syy=0.1900[/COLOR]
            20130725 Syyind=0.2000 Syy=0.2000
            20130725 Syyind=0.2000 Syy=0.2000
            .....................................
            And why it's only one Print() in script and 3 rows on 1 date in Output?

            Comment


              #51
              It would appear that you have not added any sort of BarsInProgress filter. Without doing so, you will get an update for each instrument added.

              Please try adding some filter to capture only the values you wish to update when the corresponding bar updates:

              Code:
              if(BarsInProgress == 0)
              //print someting
              MatthewNinjaTrader Product Management

              Comment


                #52
                Well, it's more interesting that I thought it is =))))
                Instrument has 1 day lag!!!
                20140121 Syyind=-0.0500 Syy=-0.0400
                20140122 Syyind=-0.1100 Syy=-0.0500
                20140123 Syyind=-0.0900 Syy=-0.1100
                20140124 Syyind=-0.0900 Syy=-0.0900

                Click image for larger version

Name:	Syy1daylag.PNG
Views:	1
Size:	11.5 KB
ID:	869881

                As you can see at the pict (printscreen from NT historical data manager), the last data day was 23JAN2014=-0.09. Indicator shows real, instrument shows 1 day lag. WHY?!

                I can understand indicator, because it just continues last value, does it?

                Comment


                  #53
                  What is the Print() Statement that you are using for these logs?

                  What is the Session Template for the chart set to? Right click on the chart -> Data Series...
                  Cal H.NinjaTrader Customer Service

                  Comment


                    #54
                    Originally posted by NinjaTrader_Cal View Post
                    What is the Print() Statement that you are using for these logs?

                    What is the Session Template for the chart set to? Right click on the chart -> Data Series...
                    Session template is "use instrument settings".
                    This is my own index based on stock type instrument. I imported data as Daily closes. As you saw from Historical manager everything is loaded OK. And indicator on this instrument shows real data. But instrument lags 1 day. It shows 24JAN, but last in history is 23JAN.
                    Click image for larger version

Name:	syysettings.PNG
Views:	1
Size:	9.3 KB
ID:	869890
                    Here is structure of code
                    protected override void OnBarUpdate()
                    {
                    ..........................
                    if (BarsInProgress==0) //start BarsInProgress for general instrument
                    {
                    ..........................
                    Print(ToDay(Time[0])+" IRind="+MyIndex(MyIndex1)[0].ToString("N4")+" IR="+Closes[1][0].ToString("N4")+" Syyind="+MyIndex(MyIndex2)[0].ToString("N4")+" Syy="+Closes[2][0].ToString("N4"));
                    } //end BarsInProgress for general instrument
                    }

                    Comment


                      #55
                      Alex,

                      In what time zone are you located in?

                      You are using the default 24/7 session template for the instrument. If you not in Eastern time zone of UTC -5, or less, then what happens with the daily data is that the end time will cause it to show the next day, the 24th in this case.

                      Try changing your PC clock to Eastern time zone and restart NinjaTrader and test your indicator out again.
                      Cal H.NinjaTrader Customer Service

                      Comment


                        #56
                        Originally posted by NinjaTrader_Cal View Post
                        Alex,

                        In what time zone are you located in?

                        You are using the default 24/7 session template for the instrument. If you not in Eastern time zone of UTC -5, or less, then what happens with the daily data is that the end time will cause it to show the next day, the 24th in this case.

                        Try changing your PC clock to Eastern time zone and restart NinjaTrader and test your indicator out again.
                        I imported data as "UTC" DAILY.
                        I've changed my PC clock to UTC only because of NT "cases" with time in different instruments. I did that year ago.
                        So, as result data in Historical manager is OK.
                        As wrote before, my stock instrument lags 1 day. I'll try to change PC clock to ETZ. BUT it's not solving!!!

                        P.S. Well, to tell the truth this is one SUPER "bad thing" in NT. PLEASE do something with it. At my first acquaintance with NT it was real piles. I never have any problems with time in other trading software.
                        Last edited by alexstox; 02-18-2014, 04:25 PM.

                        Comment


                          #57
                          1) I can't understand one thing. I imported data as Daily bars with no time
                          20030814;0.6445;0.6445;0.6445;0.6445;1
                          20030815;0.5947;0.5947;0.5947;0.5947;1

                          My PC clock was UTC.
                          In NT Import: Format- "NT.... end of bar time", Data Type- "Last", TZ of imported data- "UTC".
                          WHY with all this session problem still persist?

                          2) Solving was: change session to US equities RTH (I leave my PC clock on UTC) and to have opportunity to change session in Instrument manager - check the nyse exchange in right list.
                          After all, now instrument (stock) shows real data, but indicator lags
                          In indicator CalculateOnBarClose=false;

                          3) And one more interesting thing. Look what we have if in strategy Print() not in BarsInProgress==1
                          20140117 IRind=1.0000 IR=1.0000 Syyind=-0.0400 Syy=-0.0400
                          20140117 IRind=1.0000 IR=1.0000 Syyind=-0.0400 Syy=-0.0400
                          20140117 IRind=1.0000 IR=1.0000 Syyind=-0.0400 Syy=-0.0400
                          20140120 IRind=1.0000 IR=1.0000 Syyind=-0.0500 Syy=-0.0400
                          20140121 IRind=1.0000 IR=1.0000 Syyind=-0.0500 Syy=-0.0500
                          20140121 IRind=1.0000 IR=1.0000 Syyind=-0.0500 Syy=-0.0500
                          20140121 IRind=1.0000 IR=1.0000 Syyind=-0.1100 Syy=-0.0500
                          20140122 IRind=1.0000 IR=1.0000 Syyind=-0.1100 Syy=-0.1100
                          20140122 IRind=1.0000 IR=1.0000 Syyind=-0.1100 Syy=-0.1100
                          20140122 IRind=1.0000 IR=1.0000 Syyind=-0.1100 Syy=-0.1100
                          20140123 IRind=1.0000 IR=1.0000 Syyind=-0.1100 Syy=-0.0900
                          20140123 IRind=1.0000 IR=1.0000 Syyind=-0.0900 Syy=-0.0900
                          20140123 IRind=1.0000 IR=1.0000 Syyind=-0.0900 Syy=-0.0900

                          two of indicator values are OK, one lags...

                          Comment


                            #58
                            So, what do you think? Why indicator now lags? =)

                            Comment


                              #59
                              OMG!!! I've found the problem.
                              Dear NT, please add this to your help!

                              Everyone who import anything to NT,
                              MUST edit session template of imported instrument to session that you will use.

                              For example. You want to trade and write script for Forex. All instrument there have "Forex" session template. So, you should change your imported instrument session to "Forex" in Tools-Instrument Manager.

                              Comment


                                #60
                                Error on calling OnBarUpdate() method for indicator MyIndex()

                                Hello. I added own index to Strategy Analyzer. This index copies stock instrument data. So, I've got "Error on calling OnBarUpdate() method for indicator MyIndex() on bar 2: You are accessing the index with value that is invalid since its out of range..."
                                Well, for bars data we use CurrentBars, but what I can use for indicator?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Jonafare, 12-06-2012, 03:48 PM
                                5 responses
                                3,985 views
                                0 likes
                                Last Post rene69851  
                                Started by Fitspressorest, Today, 01:38 PM
                                0 responses
                                2 views
                                0 likes
                                Last Post Fitspressorest  
                                Started by Jonker, Today, 01:19 PM
                                0 responses
                                2 views
                                0 likes
                                Last Post Jonker
                                by Jonker
                                 
                                Started by futtrader, Today, 01:16 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post futtrader  
                                Started by Segwin, 05-07-2018, 02:15 PM
                                14 responses
                                1,792 views
                                0 likes
                                Last Post aligator  
                                Working...
                                X