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?

        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 kempotrader, Today, 08:56 AM
                0 responses
                6 views
                0 likes
                Last Post kempotrader  
                Started by kempotrader, Today, 08:54 AM
                0 responses
                4 views
                0 likes
                Last Post kempotrader  
                Started by mmenigma, Today, 08:54 AM
                0 responses
                2 views
                0 likes
                Last Post mmenigma  
                Started by halgo_boulder, Today, 08:44 AM
                0 responses
                1 view
                0 likes
                Last Post halgo_boulder  
                Started by drewski1980, Today, 08:24 AM
                0 responses
                4 views
                0 likes
                Last Post drewski1980  
                Working...
                X