Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop loss

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

    Stop loss

    How i can stop my strategy when trade is done. (until my position Rich stop loss or profit target).

    Thank You

    #2
    forexx, please take a look at the reference sample that goes over exactly what you're looking for - Halting a Strategy Once User Defined Conditions Are Met
    AustinNinjaTrader Customer Service

    Comment


      #3
      reply

      You misunderstood my question. I wan't my stratedgy disabled temporarily until my open trade reaches stop loss or at the profit target.

      Comment


        #4
        forexx, you can use the MarketPosition property to determine whether or not you are in a position and act accordingly:
        Code:
        if (Position.MarketPosition != MarketPosition.Flat)
        {
        // you are in a position, do nothing
            return;
        }
        else // you are not in a position
        {
            // put trading code here
        }
        If you decide to use this approach, be sure to set your stops and targets in a section of code that gets executed, or the position will never be closed.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        22 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        121 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        176 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        92 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        134 views
        0 likes
        Last Post cmoran13  
        Working...
        X