Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Manual exit instead of stoploss

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

    Manual exit instead of stoploss

    Hello,
    As part of my strategy I want to use a manual exit instead of a stoploss so I can tag my exit. My thought was to use this:
    //Stoploss
    if (Close[0] == Position.AvgPrice - 35 * TickSize)
    {
    ExitLong("Stoploss", "Long");
    }
    This works eventually, but the market actually moves past (sometimes very far past) the 35 ticks then as it comes back comes back the Exit may get filled. Sometimes price passes though that -35 spot many times.
    Oh I got it! Close[0] has to equal that spot. Maybe I just have to say < instead of ==?
    Sweet that did it!
    I'll post this anyway. Maybe it will help someone else.
    Thanks

    #2
    Follow up on last post.
    The problem with that idea is the stoploss is going to be more than 35 ticks because the bar has to close. I tried GetCurrentAsk() instead of Close[0], but that doesn't change anything.
    Any suggestions on how to get the 35 tick stoploss without using SetStopLoss()?
    Thanks

    Comment


      #3
      You can use ExitLongStop(), and specify the price you want the order submitted at. Anytime you access Position.AvgPrce, you should check that you are in a position or else this returns zero.

      if (Position.MarketPosition == MarketPosition.Long)
      ExitLongStop(Position.AvgPrice - 35 * TickSize);
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by CaptainAmericaXX View Post
        Follow up on last post.
        The problem with that idea is the stoploss is going to be more than 35 ticks because the bar has to close. I tried GetCurrentAsk() instead of Close[0], but that doesn't change anything.
        Any suggestions on how to get the 35 tick stoploss without using SetStopLoss()?
        Thanks
        Not unless you set CalculateOnBarClose to false. Remember the load that that puts on your resources.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        567 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 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
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X