Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical Property always returns False

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

    Historical Property always returns False

    Given the following strategy running on ES 5 min bars with Default 24/7 session template:
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Initialize()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]CalculateOnBarClose = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
     
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// when this is added Historical always returns false[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//Add("ES 12-10", PeriodType.Day, 1);[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
    [SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].Format([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"CurrentDate={0} BarsInProgress={1} Historical={2} BarTime={3}"[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], DateTime.Now.ToString(), BarsInProgress.ToString()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New], Historical.ToString(), Time[[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]].ToString()));[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [/SIZE][/FONT]
    after adding the daily dataseries the Historical property always returns False. Am I doing something wrong?

    Output windows follows:


    before adding daily dataseries
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 7:55:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:00:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:05:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:10:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:15:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:20:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:25:00 PM
    CurrentDate=10/11/2010 8:42:27 PM BarsInProgress=0 Historical=True BarTime=10/11/2010 8:30:00 PM
    after adding daily dataseries
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 7:55:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:00:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:05:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:10:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:15:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:20:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:25:00 PM
    CurrentDate=10/11/2010 8:42:56 PM BarsInProgress=0 Historical=False BarTime=10/11/2010 8:30:00 PM

    #2
    hemlock, you simply have no realtime data then until a new daily bar starts, where as with only 1 min bars running the condition is fullfilled much quicker.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      I don't understand. If my primary data series is ES 5 min and I have no secondary data series, the Historical property is equal to True for all bars until the first real-time bar is complete. This is what I would expect.

      When I add a secondary data series (ES Daily), all of the historical bars for the primary series (BarsInProgress=0) has a Historical property equal to False. Why does the Historical property change to false for the primary data series which is still ES 5 min. It does make sense to me.

      I tested on NT 6.5 and it does not act this way.

      Comment


        #4
        Are you sure you are on the latest NT7 version? This does not happen on my end here.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hey Josh, 7.0.0.22 ?

          Comment


            #6
            Yes, B22 would be the current latest version. If you are on this version and still see this behavior please outline steps we can follow to achieve the same effect as you are seeing. Thank you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              OK. Just for grins I'm going to re-install and I will let you know one way or the other. Thanks Josh.

              Comment


                #8
                Josh,

                After unistalling and reinstalling B22 I continue to have problems. Using the strategy listed below on ES 5 minute bars and the Default 24/5 session template, every primary bar's historical property is equal to false.

                Ken

                Code:
                [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#000000] Initialize()[/COLOR]
                {
                CalculateOnBarClose = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];
                Add([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"ES 12-10"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], PeriodType.Day, [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]); 
                }
                [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()
                {
                Print([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].Format([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"CurrentDate={0} BarsInProgress={1} Historical={2} BarTime={3}"
                [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], DateTime.Now.ToString(), BarsInProgress.ToString()
                , Historical.ToString(), Time[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]].ToString()));
                }
                [/SIZE][/FONT][/SIZE][/FONT]

                Comment


                  #9
                  Ran your script on a 5min chart with secondary as 1min and 1day, as an indicator and strategy, didn't run into any issue:
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=0 Historical=True BarTime=10/18/2010 2:05:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:05:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:06:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:07:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:08:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:09:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=0 Historical=True BarTime=10/18/2010 2:10:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:10:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:11:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:12:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:13:00 PM
                  CurrentDate=10/18/2010 4:55:32 PM BarsInProgress=1 Historical=True BarTime=10/18/2010 2:14:00 PM
                  In your uninstall process, did you delete out your whole NinjaScript assembly by removing Documents\NinjaTrader 7?
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Yes, I removed ..\Documents\NinjaTrader 7

                    I get True's as well when I run the script as an indicator but get False's when I run as a strategy. Can you try it as a strategy?


                    Additionally, I only get OnBarUpdate events for BarsInProgress=0. The event is never fired for the secondary series.
                    Last edited by hemlock; 10-18-2010, 05:19 PM.

                    Comment


                      #11
                      We'll look into hemlock - I was see a questionable outcome here in my testing as well.

                      Thanks for reporting in.
                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Jonker, Yesterday, 01:19 PM
                      1 response
                      12 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by JTorre, Today, 08:11 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post JTorre
                      by JTorre
                       
                      Started by Jimmyk, 01-26-2018, 05:19 AM
                      7 responses
                      853 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by algospoke, Today, 06:41 PM
                      0 responses
                      5 views
                      0 likes
                      Last Post algospoke  
                      Started by D Trader, 05-02-2017, 09:12 AM
                      20 responses
                      4,270 views
                      0 likes
                      Last Post cre8able  
                      Working...
                      X