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 cmoran13, Yesterday, 01:02 PM
            0 responses
            29 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            21 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            160 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            95 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            148 views
            2 likes
            Last Post CaptainJack  
            Working...
            X