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 michi08, 10-05-2018, 09:31 AM
    3 responses
    740 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by sightcareclickhere, Today, 01:55 PM
    0 responses
    1 view
    0 likes
    Last Post sightcareclickhere  
    Started by Mindset, 05-06-2023, 09:03 PM
    9 responses
    258 views
    0 likes
    Last Post ender_wiggum  
    Started by Mizzouman1, Today, 07:35 AM
    4 responses
    18 views
    0 likes
    Last Post Mizzouman1  
    Started by philmg, Today, 01:17 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X