Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changeing from Single Limit Order to multiple in both directions.

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

    Changeing from Single Limit Order to multiple in both directions.

    Hello There

    I have currently a strategy running.
    with the current SL TP and Order Entries.


    SetProfitTarget("", CalculationMode.Ticks, Target);
    SetStopLoss("", CalculationMode.Ticks, Stop, false);

    EnterLongLimit(0, true, Contracts, POC[1] + (tickoffset * TickSize) , "Long Limit");
    EnterShortLimit(0, true, Contracts, (POC[1] - (tickoffset * TickSize)) , "Short Limit")


    at the moment i can only have 1 order open at a time.

    What i would like to acomplish is the posibility for the strategy to submit many limit orders long below current price and short above.
    I would likt to have the run until they hit thier SL or TP.

    if i change the option "EntriesPerDirection" to 3 or 5 i can still only have orders and positions in one direction.

    I know that when both a short and Long trade would be running at the same time.
    I would be flat waiting on one of the stops or targets to be hit.

    please correct me if i am wrong here.
    I have been searching a bit and is it correctley understood the only way i can acomplish this is by changing the order enty to use ATMs instead,
    and if so how would an example look like.



    Donto
    NinjaTrader Ecosystem Vendor - otrading.dk

    #2
    Hello donto,

    Thank you for your post.

    You mentioned the following:
    "I know that when both a short and Long trade would be running at the same time.
    I would be flat waiting on one of the stops or targets to be hit.​"

    This information is incorrect. If the strategy position becomes flat, the stop and target orders will be canceled as the associated position will no longer exist. Ultimately, once a position is opened, a non-market entry order in the opposite direction would be ignored due to the internal order handling rules listed on this page for the Managed Approach:


    The Unmanaged Approach does not have the internal order handling rules in place, so it would allow for additional flexibility and you could likely implement logic that keeps your desired stop and target orders working as positions are scaled in/out in either direction. The Unmanaged Approach is more advanced and more information may be found in the help guide section here:


    "the only way i can acomplish this is by changing the order enty to use ATMs instead"
    You still would not be able to have active stops and targets once a position becomes flat when working with ATM strategies. The stop loss and profit target order quantities match the quantity of the open position. If you were to go 3 long with stops and targets that also have a quantity of 3, then submit an order to go 3 short with stops and targets, your position would become flat and the ATM strategy functionality would also cancel all stop and target orders.

    Please let us know if we may be of further assistance.

    Comment


      #3
      If i Open a chart and manually set a short and a long limit order.
      i submit the order by first selecting the ATM strategy in the chart trader and then right clicking

      if both are being triggered it will leve both SLs and TPs on my chart and be flat.

      Would i need to go the unmanaged route to have the same behavior in my strategy.
      Donto
      NinjaTrader Ecosystem Vendor - otrading.dk

      Comment


        #4
        Originally posted by donto View Post
        If i Open a chart and manually set a short and a long limit order.
        i submit the order by first selecting the ATM strategy in the chart trader and then right clicking

        if both are being triggered it will leve both SLs and TPs on my chart and be flat.

        Would i need to go the unmanaged route to have the same behavior in my strategy.
        Yes, the unmanaged approach would be required to have the same behavior in a NinjaScript strategy. The reason you can't do the managed approach is because Entry() methods automatically reverse a position. If you have a long position opened, then you call an entry in the opposite direction, such as EnterShort(), an order will be submitted to close the long position (which would also cancel any stops/targets for that position) and an entry will be submitted in the other direction. This is also noted in the link I shared previously:
        • "Entry() methods will reverse the position automatically. For example if you are in a 1 contract long position and now call EnterShort() -> you will see 2 executions, one to close the prior long position and the other to get you into the desired 1 contract short position."
        Please feel free to reach out with any additional questions or concerns.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        58 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X