Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not starting from flat position

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

    Not starting from flat position

    It is often we start a strategy from a flat position. What if I want to start with an existing position, say I already have 100 shares of ABC stock from long time ago or manually purchased, I want start with applying the strategy to sell this stock, how do I let the Strategy pick up this stock to sell and how this order become manageable?

    The problem is that I cannot use ExitLongLimit() as it works only after I used EnterLongLimit().

    Can I use CreateOrder() to create a sell order?

    myOrder = myAccount.CreateOrder(ABC, OrderAction.Sell, ...);
    myAccount.Submit(new[] { myOrder });


    then I could manage this myOrder from OnOrderUpdate(), correct?

    Thanks.
    Last edited by localappleseed; 10-23-2020, 07:29 PM.

    #2
    Hello localappleseed,

    A strategy will not be able to detect any orders submitted outside of the strategy, this includes orders placed directly to an account, and includes orders placed manually, and includes orders submitted from other strategy instances.

    An unmanaged strategy can use Adopt account position start behavior to have the strategy take the position of the account.
    Below are links to the help guide.
    https://ninjatrader.com/support/help...itionaware.htm
    https://ninjatrader.com/support/help...ccountPosition
    https://ninjatrader.com/support/help...rtbehavior.htm

    Below is a link to an example.
    https://ninjatrader.com/support/foru...29#post1068829
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by JTizz, Today, 01:43 PM
    0 responses
    18 views
    0 likes
    Last Post JTizz
    by JTizz
     
    Started by Pbarrionuevo, Today, 01:45 PM
    0 responses
    12 views
    0 likes
    Last Post Pbarrionuevo  
    Started by Anthony_0709, Today, 12:12 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by bjunaid, Today, 12:44 PM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by sidlercom80, Today, 11:52 AM
    0 responses
    9 views
    0 likes
    Last Post sidlercom80  
    Working...
    X