Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order in the past

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

    Order in the past

    Hi,

    I have a strategy for DAX / FDAX. I've set the conditions only to enter trades between 9:15 and 17:30:

    if (ToTime(Time[0]) < tradetimeend
    && ToTime(Time[0]) > tradetimestart)
    {
    // Closes[1][0] refers to Dax dataseries current bar close
    if (
    Closes[1][0] >= EntryLong+0.5
    )
    {
    EnterLong(DefaultQuantity, "LO");
    }
    the strategy enters a trade when a certain value in the index is reached.
    sometimes it happens that the value is reached immediately at 9:00. because of the timefilter my strategy doesn't trade until 9:15. Exactly at 9:15 is takes the trade anyhow, although the condition was valid at 9:00 and not valid at 9:15. What can I do to prevent it from taking the trade at 9:15.

    #2
    Hi clint2008, this happens because your condition for entry is still true and when then your time filter allows trading, the trade is entered. You will have to rewrite your entry condition for example with a cross over rule.

    Comment


      #3
      Isn't there any other option to rewrite, the crossover is automaticly waiting for the bar to complete, I wouldn't want that.

      Isn't there something like the event occured n bars ago? I couldn't find it in the documentation.

      Comment


        #4
        Hi clint2008, you mean like -

        Least Recent Occurence - http://www.ninjatrader-support.com/H...urenceLRO.html

        or Most Recent Occurence - http://www.ninjatrader-support.com/H...urenceMRO.html

        Comment


          #5
          The usermanual states that MRO / LRO will not work in Multi-Instrument situations. Do you have any other suggestions?

          Thanks,
          clint2008

          Comment


            #6
            Hello,


            You will probably need to loop back to check using a "for" loop.
            DenNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X