• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy executes properly on backtests, but on real time/market replay does not

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

    Strategy executes properly on backtests, but on real time/market replay does not

    I have a strategy that seems to be executing entries when backtesting, but when playing on market replay/real time it does not.

    One particular example is a trade that takes place for FB for 06.12.2014 @ 12:10 EST (10 min bars)

    I am attaching my strategy,

    Any help will be very much appeciated.

    Thanks.


    EDIT: I actually found out that the bug was caused by a sample code that is provided in the official Samples in the programming section of the support forums.

    This thread in particular : http://www.ninjatrader.com/support/f...ad.php?t=19289

    Has anyone else tried this/can verify this?
    Attached Files
    Last edited by nikolaalx; 06-13-2014, 04:14 AM.

    #2
    Hello Nikolaalx,

    Thank you for your post.

    What are the times you are trying to run through the Start and End times?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      If you are refering to the StartHours and StartMinutes, that would be 16:50

      EndHours, EndMinutes would be 22:55

      However please keep in mind that those act only as a condition for executing an entry...and do not limit in any way the bars.


      In backtesting all works splending, however when I run in market replay, some days it executes 1 order and then stops...and some days it executes 3-4.

      I Just can't seem to get past this...and I am kind of in a dead end.

      Thanks.
      Last edited by nikolaalx; 06-16-2014, 04:39 PM.

      Comment


        #4
        Hello nikolaalx,

        Thank you for your response.

        What are the From and To Dates set to in the Market Replay Control window?

        What are the From and To Dates set to in the Strategy Analyzer when backtesting the strategy?
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          As written in the first post, the From/To dates in the market replay are 12.06.2014.

          I also happen to have used the strategy in real time (real trading mode) for that particular date 12.06.2014. Both ways (replay and real trading), the strategy executed only the first trade...and then decided not to execute any others (despite the fact that I have set 2 losting trades as a setting for stopping trading for the day).

          When optimizing I use again 12.06.2014 / 12.06.2014 with 0 required bars.
          Last edited by nikolaalx; 06-16-2014, 05:01 PM.

          Comment


            #6
            Why do you need "add (aroon (...));" 17 different times?

            At any rate, it looks like this strategy needs to start before the session to get the first bar of the session.
            Not sure when you are enable the strategy in real time or market replay.

            I'd use the print statement and nt's output window to determine exactly what the problem is.

            Comment


              #7
              I cleaned the excessive Aroon from the initialization.

              Good idea on the Print. How can I add it so I could see the number of consecutive losing trades at any time?

              I am assuming:

              Print(lastThreeTrades)

              Where should I add this so I could see the data the whole time?
              Last edited by nikolaalx; 06-16-2014, 05:51 PM.

              Comment


                #8
                Originally posted by nikolaalx View Post
                I cleaned the excessive Aroon from the initialization.

                Good idea on the Print. How can I add it so I could see the number of consecutive losing trades at any time?

                I am assuming:

                Print(lastThreeTrades)

                Where should I add this so I could see the data the whole time?
                I was thinking a little more basic to address your initial issues.


                Code:
                			if (Bars.FirstBarOfSession && FirstTickOfBar)
                			{
                				lastThreeTrades = 0;
                				priorSessionTrades = Performance.AllTrades.Count;
                Print ( "FirstBarofSession & FirstTickOfBar seen   Variables Reset.  priorSessionTrades=
                 +priorSessionTrades);
                
                
                			}

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by elizajohan, Today, 04:15 AM
                0 responses
                3 views
                0 likes
                Last Post elizajohan  
                Started by timcjpfx, Today, 03:52 AM
                0 responses
                1 view
                0 likes
                Last Post timcjpfx  
                Started by tonynt, Today, 01:42 AM
                0 responses
                7 views
                0 likes
                Last Post tonynt
                by tonynt
                 
                Started by NT-Roland, Yesterday, 04:36 PM
                0 responses
                3 views
                0 likes
                Last Post NT-Roland  
                Started by Newtrader101, Yesterday, 03:40 PM
                2 responses
                13 views
                0 likes
                Last Post Newtrader101  
                Working...
                X