Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with ATM Strategy

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

    Issue with ATM Strategy

    Hello

    I've been running an automated strategy across multiple markets for quite some time and today for the first time I encountered the following issue: a trading signal triggered an automated entry, but rather than executing I got the following error message: AtmStrategyId parameter 'testStrategyIdValue' already used.

    The relevant code snippet from my strategy looks as follows:

    if(!orderPlacedLong && my criteria here)

    {
    orderId = GetAtmStrategyUniqueId();
    AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit,High[0]+1*TickSize,High[0]+1*TickSize, TimeInForce.Day, orderId, "MyStrat", "testStrategyIdValue");
    orderPlacedLong = true;
    }


    else if (orderPlacedLong == true && High[0] <= High[1])
    {
    AtmStrategyCancelEntryOrder(orderId);
    orderPlacedLong = false;
    }

    Any pointers as to what might have happened here would be much appreciated.

    Thanks

    #2
    What is your testStrategyIdValue? Is this a hard coded string?

    Or do you set it to GetAtmStrategyUniqueId()?

    If you have not, I'd suggest using similar methods as per our help guide example. This should generate unique strings for each new ATM Strategy, rather than trying to reuse the same string:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks for your reply Matthew. I've always used "testStrategyIdValue" and it worked fine so far, but I'll follow your advice and replace it by GetAtmStrategyUniqueId(), as per the Help Guide Example.

      Thanks again.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fersanmito, Today, 03:45 AM
      0 responses
      4 views
      0 likes
      Last Post fersanmito  
      Started by several, 03-18-2025, 03:53 AM
      12 responses
      189 views
      1 like
      Last Post ntwong
      by ntwong
       
      Started by kevinenergy, 11-28-2023, 11:04 AM
      3 responses
      77 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by SilverSurfer1, 01-31-2025, 10:02 PM
      5 responses
      76 views
      0 likes
      Last Post Lee63
      by Lee63
       
      Started by DayTradingDEMON, 03-21-2025, 02:10 PM
      7 responses
      42 views
      0 likes
      Last Post DayTradingDEMON  
      Working...
      X