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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      86 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      125 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      64 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      117 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X