Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLong with ExitLong etc

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

    EnterLong with ExitLong etc

    Hi,

    Newbie to NT and had some basic questions about EnterLong / ExitLong. Looking at some examples on the net, suppose I have a strategy where I do:

    ---

    if (cond1)
    EnterLong();
    if (cond2)
    EnterShort();

    ----

    (i) in the case above, does EnterLong() automatically call ExitShort(). More specifically, if an EnterLong() occurs, and I am short 1 contract, does EnterLong() generate two (2) long contracts = the first long to cancel the short 1 contract, and the 2nd long to actually go long ?

    Suppose now, I have the case where it is much more likely to exit a long condition (e.g. by say a profit taking rule), than by a short condition:

    if (cond1)
    EnterLong();
    if (cond2)
    EnterShort();
    if (Position.MarketPosition == MarketPosition.Long && cond3)
    ExitLong();
    if (Position,MarketPosition == MarketPosition.Short && cond4)
    ExitShort();

    (ii) is this case above, suppose EnterLong() occurs a few bars after an ExitShort(). Does EnterLong() automatically know that the Position.MarketPosition is flat ?

    #2
    Hello,
    If you are in a Short position and EnterLong is called to long market orders will be placed to bring you to a long position. The same would be the case if you were Long and EnterShort was called.
    EnterLong would check the position and if it is in a flat position it would only submit one long order in the example you outlined.
    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X