Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Print output data..

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

    Time Print output data..

    When backtesting I get these results below in the strategy analyzer for the trades taken.

    Instrument Entry price Exit price Entry time Exit time
    SCTY 39.73 38.54 6/5/2013 9:51 AM 6/5/2013 9:55 AM
    SCTY 39.7 38.51 6/5/2013 9:52 AM 6/5/2013 9:55 AM
    SCTY 39.79 38.6 6/5/2013 9:53 AM 6/5/2013 9:55 AM
    SCTY 39.51 38.32 6/5/2013 9:54 AM 6/5/2013 10:00 AM

    But the data in the Output window from using the Print statement below doesn't seem to match...
    Print("Shares traded: " + Positions[4].Quantity + " Series: " + BarsArray[4].Instrument.FullName + Time[0].ToString());

    For instance the analyzer window data above shows trades at 9:51,9:52 & 9:53 but below it shows 0 shares have traded until it hits 9:54?

    Shares traded: 0 Series: SCTY6/25/2013 9:51:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:51:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:51:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:51:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:51:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:52:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:52:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:52:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:52:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:52:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:53:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:53:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:53:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:53:00 AM
    Shares traded: 0 Series: SCTY6/25/2013 9:53:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:54:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:54:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:54:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:54:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:55:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:55:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:55:00 AM
    Shares traded: 200 Series: SCTY6/25/2013 9:55:00 AM

    #2
    From which BarsInProgress do you print this info? The SA shows you the executions here, not the actual position updates which would only be guaranteed to be seen until the next OnBarUpdate, when the object would be updated internally.

    Comment


      #3
      The BIP is 4. If the SA shows the executions, I assume the output is showing the position updates. But why does it not update to 200 shares at 9:51?

      Comment


        #4
        Because the position update was then not yet seen - I would also suggest comparing to the actual Trades section in the SA.
        Last edited by NinjaTrader_Bertrand; 10-08-2013, 06:34 AM.

        Comment


          #5
          This is typical to expect? Or is this indicating there may be something that needs adjusting in the code?

          Comment


            #6
            Not possible to say from the info - what timeframes do you use here? How does the comparison to the trades tab actually works out?

            Comment


              #7
              5min primary, 1min secondary. Not sure what you mean by comparison to trades tab. Comparing to the output it doesn't seem to match. But I guess there's no way to get the time of execution to the output, only the position updates it looks like.

              Comment


                #8
                You can print the execution as well, however that would need to be done from the OnExecution() - http://www.ninjatrader.com/support/h...iexecution.htm

                The way I see it here is that you get an execution reported for the added series, however your main series is the higher timeframe one for which you see the Positions updates reported > so giving you the timestamp of the bar of the main series where the execution would fall into (keeping in mind NT would stamp at bar close).

                Comment


                  #9
                  So basically SA is giving me the 1min secondary series data, and Output is giving me the primary 5min data stamps. But why wouldn't it update to 200 shares at 9:55 instead of 9:54 if if it was updating every 5min?
                  Last edited by zachj; 10-08-2013, 07:34 PM.

                  Comment

                  Latest Posts

                  Collapse

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