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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      46 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      14 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X