Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Two conditions to exit a position

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

    Two conditions to exit a position

    Hi,
    Im using strategy analyzer to set up my strategy and really dont know how to put my condition there.

    The strategy is to enter a long position when one stock is 10% bellow the previous day close.
    And, here is the problem, exit this long position when achieve 10% profit OR 20 trade sessios after enter initial position.

    need help
    txs

    #2
    Hello GroundBurst,

    Welcome to the NinjaTrader Support Forums!

    Using the Strategy Wizard, you may setup a Profit Target to 10 percent using the Stops and Targets Screen.


    The only trouble I see is that determining 20 Trade Sessions. Which is possible but you would have do some custom coding for this.

    If you would like to custom code this you may want to use Bars.FirstBarOfSession and use a counter to count how many sessions have passed since you have entered the order.

    Here is a link to our Help Guide that goes over Bars.FirstBarOfSession that you may view.


    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    88 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    30 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    34 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    68 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X