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

A bug?

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

    A bug?

    Hi,
    In my strategy I have this code:
    Code:
    if (Historical) return;
    Print("" + Time[0].ToString() + " Historical: " + Historical.ToString() + " Time now: " + DateTime.Now.ToString());
    and this what is in output window:
    **NT** Enabling NinjaScript strategy 'MR2a/726c1b76fff741beb127e8d1abe3e135' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=TakeNoAction ExitOnClose=False Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=True CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes
    3/2/2011 1:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 2:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 3:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 4:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 5:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 6:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 7:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 8:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    3/2/2011 9:00:00 PM Historical: False Time now: 3/17/2011 4:42:45 AM
    .
    .
    .
    .
    3/17/2011 4:30:00 AM Historical: False Time now: 3/17/2011 4:42:46 AM
    3/17/2011 4:43:00 AM Historical: False Time now: 3/17/2011 4:43:00 AM
    3/17/2011 4:44:00 AM Historical: False Time now: 3/17/2011 4:44:00 AM
    3/17/2011 4:45:00 AM Historical: False Time now: 3/17/2011 4:45:00 AM
    3/17/2011 4:46:00 AM Historical: False Time now: 3/17/2011 4:46:03 AM
    3/17/2011 4:47:00 AM Historical: False Time now: 3/17/2011 4:47:03 AM
    3/17/2011 4:48:00 AM Historical: False Time now: 3/17/2011 4:48:00 AM
    How can it be???

    Baruch

    #2
    Hello Baruch, is enough historical data loaded to satisfy the min bars required here for all series you work on with this strategy?

    Thanks,
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,
      I don't understand why its important, but any way I increased the "days to load" and still the same.
      I load now 70 days. First bar is at 1/5/11 17:00. My main TF is 60 min and biggest TF is 120 min. My biggest indi is MA(365) if its important.
      The min bars required=20.

      Baruch

      Comment


        #4
        Baruch, I tried reproducing it here but was unfortunately unable to - would you mind sending the complete script and steps you take to see this to support at ninjatrader dot com?

        Thanks
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi Bertrand,
          I found the offending line:
          Code:
             Add(Instrument.FullName, PeriodType.Minute, 1, MarketDataType.Ask);
          And the problem is not "Instrument.FullName" I tried with a name too.
          The question is WHY?

          Attached is a sample strategy which demonstrates this.

          Baruch
          Attached Files

          Comment


            #6
            Thanks Baruch, which dataprovider are you normally working with? Are they providing the historical minute bid / ask data needed?

            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi Bertrand,
              No, my data providers do not supply historical bid/ask. (Kinetick & MB Forex) I create my own ask data for backtesting. Still I don't think NT should behave like this.

              Baruch
              p.s. I don't execute it any more in live trading.

              Comment


                #8
                You would see this behaviour as you do not have any Currenbar vs BarsRequired checks in your script, please test the attached one, it should work as you expect.
                Attached Files
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by joselube001, 05-10-2024, 12:17 PM
                6 responses
                27 views
                0 likes
                Last Post joselube001  
                Started by bigc0220, 09-18-2018, 09:16 AM
                6 responses
                2,579 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by lorem, 04-25-2024, 09:18 AM
                18 responses
                78 views
                0 likes
                Last Post lorem
                by lorem
                 
                Started by DawnTreader, 05-08-2024, 05:58 PM
                21 responses
                81 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by doihaveto13, Today, 12:46 PM
                2 responses
                5 views
                0 likes
                Last Post doihaveto13  
                Working...
                X