Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Forcing a position to close

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

    Forcing a position to close

    How do I force a position to close at a specific time no matter what? How do I code it?

    For example, I use the ToTime to trade at a specific timeframe, but I'll like whatever position I have open, to close immediately when the specific timeframe ends.

    #2
    Same approach as when entering.

    Monitor bar time by checking ToTime(Time[0]) == X where X is the bar time you wish to close the position and then call ExitLong() if long or ExitShort() if short.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    169 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    324 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    250 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    351 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    180 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X