• 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

How can I call AtmStrategyClose from an Add On?

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

    How can I call AtmStrategyClose from an Add On?

    Hi,

    I am using NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy to start an ATM strategy from an AddOn.

    // Submits our entry order with the ATM strategy named "myAtmStrategyName"
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy("myAtmStrategyName", entryOrder);

    What is the equivalent to AtmStrategyClose(string atmStrategyId) that I can call from an AddOn to close my ATM?

    In other words, how can I close the position, hence the ATM strategy, from an add on?

    Thank you!
    jmneto

    #2
    Hello jmneto,

    In this case, this is not going to be similar to a NinjaScript strategy as you are submitting manual orders.

    If you want to close the position, you could use the Account object and its Positions collection to close the position that was opened. You can also use the Flatten method if you wanted to specify an instrument rather than using logic to pick the position.

    https://ninjatrader.com/support/help...ns_account.htm

    a simple example of closing the first located position:

    Code:
    account.Positions[0].Close();
    https://ninjatrader.com/support/help...us/flatten.htm


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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by aligator, Today, 12:29 PM
    0 responses
    6 views
    0 likes
    Last Post aligator  
    Started by bob77713, Today, 11:30 AM
    0 responses
    0 views
    0 likes
    Last Post bob77713  
    Started by FMtrader, 03-15-2019, 02:30 AM
    6 responses
    38 views
    0 likes
    Last Post James108  
    Started by timko, Today, 08:18 AM
    0 responses
    2 views
    0 likes
    Last Post timko
    by timko
     
    Started by victorsmith, Today, 06:00 AM
    0 responses
    6 views
    0 likes
    Last Post victorsmith  
    Working...
    X