• 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 alwathein, Today, 02:15 AM
    0 responses
    2 views
    0 likes
    Last Post alwathein  
    Started by norstrigh, Yesterday, 11:58 PM
    0 responses
    4 views
    0 likes
    Last Post norstrigh  
    Started by swcooke, Yesterday, 08:34 PM
    0 responses
    4 views
    0 likes
    Last Post swcooke
    by swcooke
     
    Started by tvaughan4, Yesterday, 04:37 PM
    0 responses
    3 views
    0 likes
    Last Post tvaughan4  
    Started by Convert, Yesterday, 03:44 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X