Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Use a variable for ATM Strategy template

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

    Use a variable for ATM Strategy template

    I would like to be able to use a variable for the ATM Strategy template name but I cannot get it to work correctly. Below is the code I have in my strategy......

    #region Variables
    // Wizard generated variables
    private string aTM_Template = @"StrategyAtm2"; // Default setting for ATM_Template


    #region Properties
    [Description("Enter the name of the ATM Strategy Template you wish to use")]
    [GridCategory("ATM Strategy Template")]
    public string ATM_Template
    {
    get { return aTM_Template; }
    set { aTM_Template = value; }
    }




    {
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();
    AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, "ATM_Template", atmStrategyId);


    }

    #2
    mlarocco, can you please clarify what exactly is not working? It would compile for you normally? And if you then enter the already setup ATM strategy template name in your user input, what would happen?

    Comment


      #3
      Thanks for your reply, I did get it figured out. I needed to remove the " " marks from around the ATM template name..... see below....

      AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, ATM_Template, atmStrategyId);

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      66 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 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