Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATMStrategyCreate query

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

    ATMStrategyCreate query

    I want to keep type of order entry selectable from ATMStrategyCreate method but it seems there is some problem with the code. Can anybody correct the code so that it selects market/limit orders as a user variable.

    Code:
     
    //variables for ATM
     
    private string atmStrategyId  = string.Empty; // Variable to hold the atmStrategyId 
    private string orderId    = string.Empty; // Variable to hold the orderId
     private string aTMStrategy   = string.Empty; // select ATM strategy from your saved ones
     private OrderType typeEntry         = OrderType.Market; //select type of entry prder
     private int limitOffset             = 1;  // Limit order offset
     private int stopOffset             = 1;  //stop order offser
     
    //OnBarUpdate content
     
    AtmStrategyCreate(OrderAction.Buy, TypeEntry, (TypeEntry != OrderType.Market ? Close[0]+LimitOffset*TickSize : 0),
         (TypeEntry != OrderType.StopLimit ? 0 : (Close[0]+StopOffset*TickSize)), TimeInForce.Day, orderId,  
         "ATMStrategy", atmStrategyId);
     
    //properties panel
     
    [Description("Type of order to be placed")]
      [Gui.Design.DisplayName("\t\tATM Strategy, Order Type")]
      [Category("Parameters")]
            public OrderType TypeEntry
            {
             get { return typeEntry ; }
       set{typeEntry = (value == OrderType.Market ? OrderType.Market : (value == OrderType.StopLimit ? OrderType.StopLimit : OrderType.Limit));}  
      }
            [Description("Number of ticks for Limit Order from the trigger bar CLOSE (1 tick should equate to next bar open).")]
      [Gui.Design.DisplayName("\t\tOrder Offset, Limit")]
      [Category("Parameters")]
            public int LimitOffset
            {
             get { return limitOffset ; }
       set{limitOffset = value;}  
      }
     
       [Description("Number of ticks for the StopLimit Order Stop price from the trigger bar projected High or Low (1 tick should equate to next bar open).")]
      [Gui.Design.DisplayName("\t\tOrder Stop Offset, StopLimit")]
      [Category("Parameters")]
            public int StopOffset
            {
             get { return stopOffset ; }
       set{stopOffset = value;}  
      }

    #2
    Hello,

    Thanks for the note.

    Just to clarify is this for the entry order or for the stop loss and profit targets?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Hi


      This is the entry order when ATM is called for.
      There is a variable ATMStrategy and TypeEntry for choosing ATM strategy and the market/limit/stop order on main strategy entry signal. It works with market or limit order only but I want to keep it selectable from these three orders.

      Comment


        #4
        Hello,

        Only recommendation I would have here in this case is to allow this is to have 2+ separate ATMStrategyCreate() calls. One for stoplimit, the other for stop market.

        Then when the user selects a mode, check that condition that the user selected. For example have the user set a string or a number to 1 for stop limits. the number 2 for stop markets.

        Then do an if statement to submit the correct order statement depending on the users selection.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        83 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        47 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        29 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        66 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X