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 cre8able, Today, 01:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by manitshah915, Today, 12:59 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by ursavent, Today, 12:54 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Mizzouman1, Today, 07:35 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RubenCazorla, Today, 09:07 AM
    2 responses
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X