Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Move Stoploss/TakeProfit set by ATM with Strategy

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

    Move Stoploss/TakeProfit set by ATM with Strategy

    I am trying to use AtmStrategyChangeStopTarget()



    I have tried so many things. I'm trying to make my strategy move the stop loss or take profit. It seems like no matter what I do I can't get it to do it.

    To give a clear example, I'm trying to make it so that if a candle has less than N percent top wick, and closes above the sell entry, it exits the trade. I have it properly detecting the candle has less than N percent and needs to exit, but it closes over my entry and fits the percent requirement, and nothing happens. There's a few more of similar conditions i'm trying to do, but if someone could help me with just that part that'd be incredible.
    Last edited by imjustkaze; 05-12-2025, 12:53 PM.

    #2
    Hello imjustkaze,

    Thank you for your post.

    If you're using Atm Strategy methods to submit your orders, you'll need to use AtmStrategyChangeStopTarget() to move your stop loss or take profit.



    Take a look at SampleAtmStrategy included in NinjaTrader, it demonstrates using this method to change the stop price.

    Please let us know if you have any further questions.

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post
      Hello imjustkaze,

      Thank you for your post.

      If you're using Atm Strategy methods to submit your orders, you'll need to use AtmStrategyChangeStopTarget() to move your stop loss or take profit.



      Take a look at SampleAtmStrategy included in NinjaTrader, it demonstrates using this method to change the stop price.

      Please let us know if you have any further questions.

      Hi Gaby, and thanks for your reply. I am attempting to call AtmStrategyChangeStopTarget() so that when one of my percent conditions is true we exit the position or move the stop to break even.


      private bool AdjustStopLoss(string atmStrategyId, double newStopPrice)
      {
      if (string.IsNullOrEmpty(atmStrategyId))
      return false;

      // CRITICAL: Check that we actually have a position before modifying the stop
      if (GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat)
      {
      Print($"[PsychDeltaStrategy] Cannot adjust stop loss - position is flat");
      return false;
      }

      Print($"[PsychDeltaStrategy] Adjusting stop loss to {newStopPrice:0.00} for ATM strategy {atmStrategyId}");

      // Use "STOP1"
      return AtmStrategyChangeStopTarget(0, newStopPrice, "STOP1", atmStrategyId);
      }​

      am I doing something wrong?

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      110 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      59 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      41 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      78 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X