Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ErrorCode returned when executing the AtmStrategyCreate(...) - help needed

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

    ErrorCode returned when executing the AtmStrategyCreate(...) - help needed

    Hi support,

    When my strategy executes the AtmStrategyCreate() command and the specified ATM template name does not exists, i get "Panic" as ErrorCode. As i suspect the Panic error may be returned for different situations, is there a way to find specifically if an ATM template name exists before calling the AtmStrategyCreate() command ?

    I'd be grateful for your help.

    #2
    I have found this solution but would be interested to learn if there is another way:

    Code:
    using System.IO;
    
    private bool IsTemplateNameExists(string templateName)
    {
    string pathToTemplates = NinjaTrader.Core.Globals.UserDataDir + "templates\\AtmStrategy" + "\\" + templateName + ".xml";
    if (File.Exists(pathToTemplates))
    return true;
    else
    return false;
    }

    Comment


      #3
      Hello trendisyourfriend,

      Thank you for the post.

      There is actually nothing documented/recommended in this situation. The method just simply expects a valid template and the error just returns panic. Adding error handling like you have would likely be the best solution to avoid the AtmStrategyCreate having an error for a missing template.

      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X