Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

LongLimit

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

    LongLimit

    Hello. I have a doubt. I would like to enter a limit order between the close and the low of the bar..

    //vela Bajista
    if (Open[0] > Close[0])
    {

    //Suelos
    if ((Close[0] - Low[0]) / TickSize >= Distancia)
    {
    EnterLongLimit(??????);
    }

    When the Price is rejected, I would like to establish a limit order between the close and the low of the bar...

    Thanks a lot...
    Attached Files

    #2
    Hello brokerbombero,

    Thanks for your question.

    For placing a limit order at that price level between the Low and the Close, you could choose any price level between Close[0] - (Close[0] - Low[0]). If you added a multiplier, you could enter within that range in terms of a percentage of that range.

    For example:

    double PriceToEnter = Close[0] - (Close[0] - Low[0]) * Percent;

    Where Percent is a double between 0 and 1.

    As for placing another order upon order rejection, you could change the RealtimeErrorHandling of the strategy so the strategy is not aborted and then to catch the occurrence in OnOrderUpdate() to place a new limit order.

    Please be sure to also review the documentation on the Managaed Approach so the Limit order is submitted properly with the IsLiveUntilCancelled overload if you desire this behavior.

    I'll provide links to our publicly available documentation on the items discussed.

    RealtimeErrorHandling - https://ninjatrader.com/support/help...orhandling.htm

    OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm

    Managed Approach - https://ninjatrader.com/support/help...d_approach.htm
    JimNinjaTrader 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
    2 responses
    9 views
    0 likes
    Last Post fernlicht  
    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
    3 responses
    6 views
    0 likes
    Last Post memonolog  
    Started by orenytz, Today, 12:25 AM
    0 responses
    8 views
    0 likes
    Last Post orenytz
    by orenytz
     
    Working...
    X