Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limiting the number of Bars for Active Limit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Limiting the number of Bars for Active Limit

    I am suffering from a synapse meltdown!

    I want to enter a Buy Limit order 4 ticks below the signal bar Close. ( Close[0] ). How can I cancel the order if not triggered within the next 3 bars.

    I can even find documentation on this. Talk about a brain %$#@.

    Thanks

    #2
    By default, orders automatically cancel at the end of a bar therefore, you need to determine a way to *not* re-submit the order after three bars. One approach would be to create a private "int" variable outside the OnBarUpdate() method at the class level. Track the bar number the signal and order was placed (use CurrentBar) then track if the CurrentBar is greater than the bar number stored + 3 etc..
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 07:07 AM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Creamers, 04-27-2024, 05:32 AM
    9 responses
    60 views
    0 likes
    Last Post Creamers  
    Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
    19 responses
    59 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by samish18, 04-17-2024, 08:57 AM
    26 responses
    116 views
    0 likes
    Last Post samish18  
    Started by llanqui, Today, 11:13 AM
    3 responses
    3 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X