Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to monitor an ATM based strategy filling target or stop

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

    Trying to monitor an ATM based strategy filling target or stop

    Hi,

    Ive been having some troubles trying to identify a target of stop being filled on an ATM based strategy. Mainly on the last targt/stop of the ATM because it usually gets an error indicating that ATM id is terminated...
    I placed the condition on OnMarketData and it usually works fine on first targets or stops ( while still remains a position )..
    Any idea of how can I monitor this event or how can I know the result of a terminated ATM id ?

    Part of the code ( it just plots a line from start to end of trade )...:
    protectedoverridevoid OnMarketData(MarketDataEventArgs e)
    {
    if(atmLongId.Length!=0 && orderLongId.Length==0 )
    {
    string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET"+checkL, atmLongId);
    //Print(" TARGET+checkL "+checkL+" "+orders[0,0]+orders[0,1]+orders[0,2]);
    // Check length to ensure that returned array holds order information
    if (orders.Length > 0)
    {
    //for (int i = 0; i < orders.GetLength(0); i++)
    if(orders[0, 2]=="Filled")
    {
    DrawTriangleDown(
    "TL"+CurrentBar+checkL,false,0, Convert.ToDouble(orders[0,0]), lineColorS);

    Thanks !

    Pablo
    pmaglio
    NinjaTrader Ecosystem Vendor - The Indicator Store

    #2
    Hi Pablo, correct this is a limiation since at that point in time this specific ATM strategy is closed / terminated. Have you tried checking the ATM Strategy Market Position then for the state?

    Comment


      #3
      Hi Bertrand,

      Yes, used GetAtmStrategyMarketPosition(atmLongId)to check Market Position, but once it is Flat, I found no way to know if position was closed by a stop or target, neither the fill price...
      Any ideas...?
      pmaglio
      NinjaTrader Ecosystem Vendor - The Indicator Store

      Comment


        #4
        Hmm, an idea would be tracking the changes in unrealized Pnl for the ATM, if you save the last known value to a variable you could deduct if it was a profitable trade or stop out.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X