• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 krofs, Today, 03:37 PM
    2 responses
    8 views
    0 likes
    Last Post krofs
    by krofs
     
    Started by kalalex, Today, 03:51 PM
    0 responses
    2 views
    0 likes
    Last Post kalalex
    by kalalex
     
    Started by bdelorm, Today, 12:26 PM
    5 responses
    26 views
    0 likes
    Last Post bdelorm
    by bdelorm
     
    Started by kalalex, Today, 02:23 PM
    0 responses
    3 views
    0 likes
    Last Post kalalex
    by kalalex
     
    Started by kevinenergy, Today, 01:43 PM
    4 responses
    19 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Working...
    X