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

Gtc

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

    Gtc

    Suppose my code is desinged to enter a long position only once using the managed approach method EnterLong as shown in the code below.
    What happens if I set TimeInForce = TimeInForce.Gtc and for some reason the order was not executed. Is the order cancelled and I need to resubmit it or since it's GTC it will enter a long position eventually and there's no need for me to resubmit it?

    Thanks



    Code:
    private bool _didEnterPosition = false;
    
    private void OnBarUpdate()
    {
        if (!_didEnterPosition)
        {
            _didEnterPosition = true;
            EnterLong();
        }
    }

    #2
    Hello kiss987,

    Thanks for your post.

    The EnterLong() places a market order which would be filled regardless of the TimeinForce. The order would not be cancelled.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ChastiJose, Today, 03:37 AM
    0 responses
    3 views
    0 likes
    Last Post ChastiJose  
    Started by Klaus Hengher, Today, 03:13 AM
    0 responses
    4 views
    0 likes
    Last Post Klaus Hengher  
    Started by ewileznwpods, Today, 02:57 AM
    0 responses
    1 view
    0 likes
    Last Post ewileznwpods  
    Started by 1001111, Today, 01:35 AM
    0 responses
    6 views
    0 likes
    Last Post 1001111
    by 1001111
     
    Started by ETFVoyageur, Yesterday, 07:05 PM
    1 response
    16 views
    0 likes
    Last Post ETFVoyageur  
    Working...
    X