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 fernlicht, Today, 02:38 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by b16_aln, Today, 01:48 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by james272, Yesterday, 10:50 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by vaz21102, Yesterday, 09:22 PM
    2 responses
    10 views
    0 likes
    Last Post vaz21102  
    Started by keepsimple, 08-17-2017, 09:18 AM
    6 responses
    1,350 views
    1 like
    Last Post gubbar924  
    Working...
    X