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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      61 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      148 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X