• 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

Backtesting with tick data after signal from minute bar

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

    Backtesting with tick data after signal from minute bar

    So I have a system that gives a price level signal at the end of a minute bar. I want to test the effect of entering the trade when the tick-level price crosses that level. I have something like this, where series 0 is the 1M and series 1 is the tick:

    if( BarsInProgress == 1 )
    {
    if (condition)
    { EnterLong(0,1,"");
    }
    }

    But this produces mulitpel entries on the minute bar even though Entries Per Direction == 1.

    Thanks in advance

    #2
    Hello futurestack,
    Thanks for posting today.

    Based on the code snipet this does not seem to be the area of concern that is causing your strategy to enter several times.

    What is the exit condition you are using? Does it enter every time the bar updates? When does it enter multiple times?

    I look forward to further assisting.
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      Hi Alex,

      Well I think you are right that I had a stop which was causing the multiple-entry problem.

      The EnterLong which is for the higher timeframe (Series 0) should enter at the price from the tick level, right? That doesn't seem to be happening for me.

      Thanks!

      Comment


        #4
        Hello futurestack,
        Thanks for the inquiry.

        Your EnterLong() order needs to use the secondary series. To fix this change EnterLong(0,1,""); to EnterLong(1,1,"");

        I would like to clarify on this matter. Are you looking for the 1 minute data series to hit a certain value and then see if the added series hits the same level and then submit your order? Or are you waiting for the primary data series to hit a certain value and then submit an order to the secondary data series. If this is the case, please refer to the reference sample at the following link http://www.ninjatrader.com/support/f...ead.php?t=6652

        I look forward to your response.
        Alex G.NinjaTrader Customer Service

        Comment


          #5
          Hi again,

          Thanks, very helpful.

          I have made some progress. I understand now that the entries must be on the tick level even though the entry signals are generated by the higher level bars.

          If I use SetStopLoss in the multiple timeframe code, which timeframe is it set on?

          See the attached image where the stop level is set at 17944. The tick data crosses below that at about 10:30 but the stop doesn't execute until after 12:00.

          http://www.futurestrack.com/document...05-01_0721.png

          Thanks again.

          Comment


            #6
            Hello,

            The order placed by SetStopLoss() will apply to the entry order that was called, rather than a specific bar series. In other words, the bar series to which the entry order was submitted will apply to the stop loss, as well.

            In your screenshot, is it possible that your stop loss is being moved around in your code before it is filled?
            Dave I.NinjaTrader Product Management

            Comment


              #7
              Hi Dave,

              OK, I see. I don't think the stoploss could be moved, but I'll doublecheck and get back to you. Thanks!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Ilpropio, Yesterday, 09:45 PM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_EricB  
              Started by sgordet, Yesterday, 10:31 PM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_EricB  
              Started by Revan, Yesterday, 05:44 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Marco  
              Started by superg3, Yesterday, 07:57 PM
              0 responses
              4 views
              0 likes
              Last Post superg3
              by superg3
               
              Started by Longhornmark, Yesterday, 07:06 AM
              5 responses
              36 views
              0 likes
              Last Post nkhoi
              by nkhoi
               
              Working...
              X