Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How place a entry price below current price

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

    How place a entry price below current price

    Hello NT8 support,

    I'd like to place an entry order at a specific price given a set of conditions. But I am having trouble doing so. Example:

    IF (Conditions on bar close)

    {
    EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Close[0] - 3), "");
    }

    The above is meant to place a long entry order 12 ticks (3 points) below the close price at the time of the conditions. However, what happens when I test this is that the limit moves to be 12 ticks below the current price as it moves, so the limit never gets touched. I can confirm that the condition is not happening every bar. How can I make it so that the limit stays in place so that when it is touched by the price, there is an entry. thank you!

    #2
    Hello Austiner87, thanks for writing in.

    The best way to see if the condition is being reached would be to use a Print statement within the condition e.g.

    IF (Conditions on bar close)
    {
    Print("Condition Hit");
    EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Close[0] - 3), "");
    }

    If the order keeps getting updated, it means EnterLongLimit is being hit. If you can confirm the condition is being hit multiple times, you would need to either save the price level the order is submitted at and re-use that price every bar the order should be active (in the managed approach, resting orders are canceled on every bar unless they are resubmitted) or adjust your condition so that it does not get hit when not needed and use the special overload for EnterLongLimit to prevent the order from canceling at the end of every bar:

    EnterLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, string signalName) //set isLiveUntilCancelled to true to keep the order alive.


    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by nbowursw, Today, 11:12 PM
    0 responses
    3 views
    0 likes
    Last Post nbowursw  
    Started by david196, Today, 09:09 PM
    0 responses
    10 views
    0 likes
    Last Post david196  
    Started by kkc2015, Today, 08:50 PM
    0 responses
    5 views
    0 likes
    Last Post kkc2015
    by kkc2015
     
    Started by fscabrera03, Today, 06:55 PM
    0 responses
    11 views
    0 likes
    Last Post fscabrera03  
    Started by LorraineP, Today, 04:02 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Working...
    X