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

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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?
            BertrandNinjaTrader Customer Service

            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).
                BertrandNinjaTrader Customer Service

                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 jclose, Today, 09:37 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post jclose
                  by jclose
                   
                  Started by WeyldFalcon, 08-07-2020, 06:13 AM
                  10 responses
                  1,414 views
                  0 likes
                  Last Post Traderontheroad  
                  Started by firefoxforum12, Today, 08:53 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post firefoxforum12  
                  Started by stafe, Today, 08:34 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post stafe
                  by stafe
                   
                  Started by sastrades, 01-31-2024, 10:19 PM
                  11 responses
                  169 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Working...
                  X