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 junkone, Today, 11:37 AM
    0 responses
    1 view
    0 likes
    Last Post junkone
    by junkone
     
    Started by quantismo, 04-17-2024, 05:13 PM
    5 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by proptrade13, Today, 11:06 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    34 views
    0 likes
    Last Post love2code2trade  
    Started by cls71, Today, 04:45 AM
    2 responses
    10 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Working...
    X