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 muratb35, Today, 03:36 AM
    0 responses
    3 views
    0 likes
    Last Post muratb35  
    Started by fernlicht, Today, 02:16 AM
    1 response
    8 views
    0 likes
    Last Post NT-Roland  
    Started by fernlicht, 04-12-2021, 06:01 PM
    1 response
    28 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by memonolog, Today, 02:10 AM
    1 response
    4 views
    0 likes
    Last Post cincai
    by cincai
     
    Started by orenytz, Today, 12:25 AM
    0 responses
    8 views
    0 likes
    Last Post orenytz
    by orenytz
     
    Working...
    X