Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help EnterLongStop() ExitLongStop()

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

    Help EnterLongStop() ExitLongStop()

    Hello we would like to call ExitLongPosition() on the same entry but in two different output prices but we are having truble because we want each order to successfully sell the number of bars only once.

    How could I know if the operation generated by ExitLongPosition() has succeeded and thus we have sold order quantity specified.

    if(Position .MarketPosition != MarketPosition.Long )
    {
    // Declaramos la 1 cobertura Alcista en 1 desviaciones

    if (Time[0].DayOfWeek == DayOfWeek.Friday &&ToTime (Time[0])>=1845*100)


    {
    cierre= Close[0];
    EnterLongStop (8,cierre+25,"Entrada");
    ejecutada15 =false;
    ejecutada10 =false;

    }

    }

    if(Position .MarketPosition == MarketPosition.Long && ejecutada05 ==false )
    {

    ExitLongStop( 4,cierre+15,"Entrada","1close");

    ejecutada05 =true;

    }

    if(Position .MarketPosition == MarketPosition.Long && ejecutada02 ==false )
    {

    ExitLongStop(4,cierre+10,"Entrada","2close");

    ejecutada02 =true;
    }
    Last edited by optimuss; 08-26-2014, 12:32 PM.

    #2
    Hello optimuss,

    Thank you for your post.

    You can use OnOrderUpdate() to check when these orders get placed and even track their OrderState when it gets changed.
    See the link below for information on using the OnOrderUpdate() -
    http://www.ninjatrader.com/support/h...rderupdate.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thank you, sincerely.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      668 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      377 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X