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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        37 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        62 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X