• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 rtwave, Today, 04:40 AM
    0 responses
    2 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by pollard89143, Today, 04:21 AM
    0 responses
    4 views
    0 likes
    Last Post pollard89143  
    Started by Lisa Marshall, 01-25-2020, 04:17 PM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by HiddenPhilosopher, Yesterday, 11:24 PM
    0 responses
    3 views
    0 likes
    Last Post HiddenPhilosopher  
    Started by akuntysh, 01-25-2020, 08:42 AM
    2 responses
    12 views
    0 likes
    Last Post akuntysh  
    Working...
    X