• 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 Sh00tHerMcGavin, Today, 07:39 PM
    0 responses
    1 view
    0 likes
    Last Post Sh00tHerMcGavin  
    Started by Mberg, Today, 05:13 PM
    0 responses
    0 views
    0 likes
    Last Post Mberg
    by Mberg
     
    Started by Barry Milan, Today, 01:33 PM
    2 responses
    8 views
    0 likes
    Last Post marcus2300  
    Started by NW Trader, Today, 03:42 PM
    2 responses
    8 views
    0 likes
    Last Post NW Trader  
    Started by ralett, Today, 01:42 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Working...
    X