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 junkone, Today, 11:37 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post junkone
                  by junkone
                   
                  Started by quantismo, 04-17-2024, 05:13 PM
                  5 responses
                  34 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by proptrade13, Today, 11:06 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by love2code2trade, 04-17-2024, 01:45 PM
                  4 responses
                  34 views
                  0 likes
                  Last Post love2code2trade  
                  Started by cls71, Today, 04:45 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post eDanny
                  by eDanny
                   
                  Working...
                  X