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 TradeForge, 04-19-2024, 02:09 AM
    2 responses
    28 views
    0 likes
    Last Post TradeForge  
    Started by aprilfool, 12-03-2022, 03:01 PM
    3 responses
    327 views
    0 likes
    Last Post NinjaTrader_Adrian  
    Started by giulyko00, Today, 12:03 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by f.saeidi, Today, 12:14 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by AnnBarnes, Today, 12:17 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Working...
    X