Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stopping a strategy

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

    Stopping a strategy

    Hi!
    I am running a new strategy: when close cross above a price, I enter long, with SL and PT.
    Once my order is filled and closed or stopped, I need the strategy to stop, otherwihise it enters long again as the price is still above the first target.

    ¿how can stop the strategy?
    Thanks again!

    #2
    You could add a return clause in your OnBarUpdate() method such as:

    Code:
    if (Performance.RealtimeTrades.Count > 0)
        return;
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jclose, Yesterday, 09:37 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by firefoxforum12, Yesterday, 08:53 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by kmunroe478, Yesterday, 05:39 PM
    2 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    115 responses
    2,700 views
    1 like
    Last Post kevinenergy  
    Started by prdecast, Today, 06:07 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X