Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 xiinteractive, 04-09-2024, 08:08 AM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by swestendorf, Today, 11:14 AM
    2 responses
    5 views
    0 likes
    Last Post NinjaTrader_Kimberly  
    Started by Mupulen, Today, 11:26 AM
    0 responses
    2 views
    0 likes
    Last Post Mupulen
    by Mupulen
     
    Started by Sparkyboy, Today, 10:57 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by TheMarlin801, 10-13-2020, 01:40 AM
    21 responses
    3,918 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Working...
    X