Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongLimit() and EnterShortLimit()

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

    EnterLongLimit() and EnterShortLimit()

    Hi, I have some issue that I am not sure how to figure out.

    I have this strategy:

    OBU()
    {
    if(Close[0] < Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).R2[0]
    &&
    Close[0] > Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).R1[0])
    {
    EnterLongLimit(Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).R1[0],"llargs");
    EnterShortLimit(Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).R2[0],"curts");

    }

    }

    Mi aim is to set a long limit order at the R1 pivot just to wait to be filled and the same for the short limit order at the R2 pivot.

    However, with this code only the long orders are filled, the short orders looks like doesn't exist.

    I imagine that probably the two orders are against one of each other, so, what could I make for figure out this?

    Thank you!!

    #2
    Hello alextrd,
    Thanks for your post.

    Internal rules of the Managed Approach will prevent you from placing successive non market orders as entry orders in the opposite direction. More information on these internal rules can be referenced here - https://ninjatrader.com/support/help...antedPositions

    The Unmanaged Approach does not apply the same restrictions and would be advised if you would like to model a bracketed entry. Please see the following link for more information on the Unmanaged Approach: https://ninjatrader.com/support/help...d_approach.htm
    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    131 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    74 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    111 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    89 views
    0 likes
    Last Post CarlTrading  
    Working...
    X