Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 PaulMohn, Today, 05:00 AM
    0 responses
    5 views
    0 likes
    Last Post PaulMohn  
    Started by ZenCortexAuCost, Today, 04:24 AM
    0 responses
    5 views
    0 likes
    Last Post ZenCortexAuCost  
    Started by ZenCortexAuCost, Today, 04:22 AM
    0 responses
    2 views
    0 likes
    Last Post ZenCortexAuCost  
    Started by SantoshXX, Today, 03:09 AM
    0 responses
    15 views
    0 likes
    Last Post SantoshXX  
    Started by DanielTynera, Today, 01:14 AM
    0 responses
    3 views
    0 likes
    Last Post DanielTynera  
    Working...
    X