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, Today, 09:37 PM
    0 responses
    4 views
    0 likes
    Last Post jclose
    by jclose
     
    Started by WeyldFalcon, 08-07-2020, 06:13 AM
    10 responses
    1,413 views
    0 likes
    Last Post Traderontheroad  
    Started by firefoxforum12, Today, 08:53 PM
    0 responses
    10 views
    0 likes
    Last Post firefoxforum12  
    Started by stafe, Today, 08:34 PM
    0 responses
    10 views
    0 likes
    Last Post stafe
    by stafe
     
    Started by sastrades, 01-31-2024, 10:19 PM
    11 responses
    169 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X