Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TIF on target and stop orders when using StartAtmStrategy

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

    TIF on target and stop orders when using StartAtmStrategy


    Using the StartAtmStrategy() - https://ninjatrader.com/support/help...tmstrategy.htm

    I want to be able to use the specified TIF of the entry order for the Atm Strategy target and stop orders, potentially overriding what's specified in the Atm Strategy template. For example this can be done in Chart Trader, if you specify a different TIF value on the entry order, the target and stop orders will also use that TIF value. How can this be done? Thanks.



    #2
    Hello martyn73,

    For this you would need to have programmed a template which has the TIF you wanted, there is not a supported method to manage the targets of the ATM directly.

    One possible solution would be to manage this before submitting the order using a variable or logic. This would require creating two templates but then it could dynamically change between them:

    Code:
    entryOrder = account.CreateOrder(Cbi.Instrument.GetInstrument("AAPL"), OrderAction.Buy, OrderType.Market, TimeInForce.Day, 1, 0, 0, string.Empty, "Entry", null);
    
    string templateName = "NormalTemplateName";
    
    if (entryOrder.TimeInForce == TimeInForce.Day)
    {
        templateName = "NormalTemplateName_Day";
    }
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrategy(templateName, entryOrder);

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by JarodB, Today, 04:44 AM
    0 responses
    4 views
    0 likes
    Last Post JarodB
    by JarodB
     
    Started by leonardo3381, Today, 01:58 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by Mindset, Today, 02:16 AM
    0 responses
    7 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by dvcpro4, Yesterday, 07:20 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by Aramunno, Yesterday, 04:25 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Marco  
    Working...
    X