Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How I tell if a stop loss or profit target or my position is closed for an ATMStrateg

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

    How I tell if a stop loss or profit target or my position is closed for an ATMStrateg

    How I tell if a stop loss or profit target or my position is closed? when I'm using

    AtmStrategy _innerStrategy;

    lock (Account.All)
    account = Account.All.FirstOrDefault(a => a.Name == "Sim101");

    if (account != null)
    {
    entryOrder = account.CreateOrder(Instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Automated, TimeInForce.Day, 1, 0, 0, string.Empty, "Entry", Core.Globals.Now.AddDays(1), new CustomOrder());
    _innerStrategy = AtmStrategy.StartAtmStrategy("AtmStrategyTemplate" , entryOrder);
    }

    I have a handle to the instance of teh AtmStrategy in my ninjascript.

    I'm using NT 8.


    Thanks,
    Tolu

    #2
    Hello Tolu,

    Thanks for your inquiry.

    It looks like you are inquiring about identifying when an Atm Strategy's target or stop loss was filled from a NinjaScript AddOn from NinjaTrader 8. However, you have bumped this thread in the NinjaTrader 7 forum. This is a very old historical thread that refers to NinjaTrader 6 as well.

    For organization purposes, and so other clients can better navigate the forums and find resolutions, please open a new thread in the appropriate forum in the future.

    From an AddOn, you may identify if an Atm strategy has been filled by subscribing to the OrderUpdate or ExecutionUpdate events and looking for information from the Order object in your OnOrderUpdate() method or the Order object of the Execution object in your OnExecutionUpdate() method.

    I have created a demonstration video showing how I have modified our AddOn Framework example to tell me information about the owner strategy of the Order object with Order.GetOwnerStrategy() This tells me:
    1. The order belongs to an AtmStrategy
    2. A unique ID for the AtmStrategy

    This information could then be used in your own logic to track the Atm strategies you create within your AddOn.

    Demo: https://www.screencast.com/t/ofdhascf0x2

    I've included links to our publicly available documentation on the items discussed and AddOn Framework example.

    Please note that the same approach may be taken within a NinjaScript Strategy, however you would use the built in OnOrderUpdate() and OnExecutionUpdate() methods as well as the ATM strategy methods for creation. In the context of a NinjaScript Strategy, I would suggest to create your own AtmStrategy ID's for monitoring the Atm strategy.

    You may refer to the SampleOnOrderUpdate Strategy and associated documentation for further direction in the context of a Strategy. I will also link the Atm Strategy methods documentation for use in the strategy.

    Please let me know if you have any questions.
    Last edited by NinjaTrader_Jim; 11-28-2017, 09:49 AM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    577 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X