Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit Orders for entries and exits in strategies

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

    Limit Orders for entries and exits in strategies

    Hi folks:

    What code would I use to turn this:

    Code:
    {
                        EnterLong(DefaultQuantity, "BuyMkt"); //Initial trade setup.
     }
    into this:

    1. Enter a long limit order at the current BID price or better but not to exceed +3 ticks worse & if it does not execute the limit order within 1 min, then cancel the limit order....i.e. wait for the next signal...etc...

    My goal is the get my price on entry or not at all to ensure control of slippage or not at all and wait for the next signal...

    AND turn this:

    Code:
    {
                        Print ("Condition 2 Exit Short");
                        ExitShort("Condition 2 Exit Short", "");
                        // OFF Disable();
                    }
    into this:

    2. Exit Long position with a limit order at the current ASK price or better but if the last price exceeds +3 ticks worse then cancel the limit order and immediately enter a Market Exit Long order & also if the limit order is not filled within 5 seconds then cancel the limit order and enter an immediate Market Exit Long order...cancel any associated orders and wait for the next entry signal...etc

    My goal is to test exit limit performance (I will also have a emergency stop market order further below) as a backup. I am seeking to improve exit slippage performance (at least see if it makes a difference...I know it does for a fact for entries in many cases)....usually I will have a limit to enter and market to exit.

    If you can think of any other parameter to add, then you are welcome to suggest.



    Greg

    #2
    Greg, unfortunately I would not be aware of sample or snippet shared already that would do this custom order management for you, I would therefore suggest creating it according to your specs with NinjaScript.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    672 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    577 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X