Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to load ATM strategy template from file 'C:\Users\

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

    Unable to load ATM strategy template from file 'C:\Users\

    Hello,

    I incorporated an ATM into my strategy , it was working great placing trades with the correct ATM name , then I did a restart on NT8 now I keep getting the message down below. I have deleted all the ATM's and created a new one and I still see the same issue. Any ideas? I can't find much on this subject.

    Unable to load ATM strategy template from file 'C:\Users\je***\Documents\NinjaTrader 8\templates\AtmStrategy\Defualt.xml'

    #2
    A bit more info, this seems to only be impacting longs , shorts work fine. This kind of implies my code is wrong but its exactly the same as the short minus the order action is a buy. The if and else if are true for the long and shot , I can see with print messages we are going in there , but only the logs get the error reading the ATM in the templates directory.

    if (orderId.Length == 0 && atmStrategyId.Length == 0 && *** long conditions
    {

    isAtmStrategyCreated = false; // reset atm strategy created check to false
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();
    AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, "Defualt", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
    //check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
    if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
    isAtmStrategyCreated = true;
    });


    }
    else if (orderId.Length == 0 && atmStrategyId.Length == 0 && *** short conditions
    {

    isAtmStrategyCreated = false; // reset atm strategy created check to false
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();
    AtmStrategyCreate(OrderAction.SellShort, OrderType.Market, 0, 0, TimeInForce.Day, orderId, "Default", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
    //check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
    if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
    isAtmStrategyCreated = true;
    });
    }
    if (!isAtmStrategyCreated)
    return;

    // Check for a pending entry order
    if (orderId.Length > 0)
    {
    string[] status = GetAtmStrategyEntryOrderStatus(orderId);

    // If the status call can't find the order specified, the return array length will be zero otherwise it will hold elements
    if (status.GetLength(0) > 0)
    {
    // Print out some information about the order to the output window
    Print("The entry order average fill price is: " + status[0]);
    Print("The entry order filled amount is: " + status[1]);
    Print("The entry order order state is: " + status[2]);

    // If the order state is terminal, reset the order id value
    if (status[2] == "Filled" || status[2] == "Cancelled" || status[2] == "Rejected")
    orderId = string.Empty;
    }
    } // If the strategy has terminated reset the strategy id
    else if (atmStrategyId.Length > 0 && GetAtmStrategyMarketPosition(atmStrategyId) == Cbi.MarketPosition.Flat)
    atmStrategyId = string.Empty;
    if (atmStrategyId.Length > 0)
    {
    // You can change the stop price
    if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
    // AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);

    // Print some information about the strategy to the output window, please note you access the ATM strategy specific position object here
    // the ATM would run self contained and would not have an impact on your NinjaScript strategy position and PnL
    Print("The current ATM Strategy market position is: " + GetAtmStrategyMarketPosition(atmStrategyId));
    Print("The current ATM Strategy position quantity is: " + GetAtmStrategyPositionQuantity(atmStrategyId));
    Print("The current ATM Strategy average price is: " + GetAtmStrategyPositionAveragePrice(atmStrategyId)) ;
    Print("The current ATM Strategy Unrealized PnL is: " + GetAtmStrategyUnrealizedProfitLoss(atmStrategyId)) ;
    }
    }

    }
    Last edited by jeffom; 08-27-2022, 02:25 PM.

    Comment


      #3
      Figured it out a stupid spelling error. All set

      Comment


        #4
        Hello jeffom,

        I am seeing Default is spelled wrong.

        'C:\Users\je***\Documents\NinjaTrader 8\templates\AtmStrategy\Defualt.xml'

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        61 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X