Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hard code timeframe

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

    Hard code timeframe

    I have noticed when running an auto strategy that any active order that has not been filled is cancelled and re-entered every time a bar ends and starts si it goes to the back of the queue.

    So a solution might be to hard code the time frame that a function (like ATR) is using into the strategy, but actually run the strategy on a 60 minute chart, so the strategy calculates as if on a shorter time frame i.e. 1 minute, but the orders are only cancelled every 60 minutes.

    Is this possible? If so can you give me a code snippet?

    Thanks
    Malcolm

    #2
    Malcom

    Do a Help Search for liveUntilCancelled. The solution is in there.

    Comment


      #3
      Thanks TAJTrades!

      Malcolm, as a standard procedure orders not resubmitted will expire as you have noted.

      You can either set a flag and rebsubmit then until you are filled, or use the liveUntilCancelled overload as outlined here - http://www.ninjatrader-support.com/H...verview36.html

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      333 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X