Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

enter last close price

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

    enter last close price

    Hello,

    Question:

    This is a piece of my strat, but I am unsure about one item, XXXX, I wouls like for an order to be placed when the condition is met (if close...) I want to enter long 1 at the price of the last bar close (close[0].....help ??) , now, in addition , if If for example the market would increase and my position would not be filled (but the order would still stand) how do I cancel the order if the current stock price is 2 ticks above my limit entry price ? . My second condition would simply just state that if the position is filled, it would close automaticly if the bars since entrey is 1.

    if (Close[0] > Open[0])
    {
    EnterLongLimit(1, XXXXX, "contractlong1");
    PrintWithTimeStamp("contractlong1");
    }

    // Condition set 2
    if (BarsSinceEntry() >= 1)
    {
    ExitLong("contractexit1", "contractlong1");
    }

    sending me in the right direction would be appreciated.

    #2
    Hi chancehero,

    Keep in mind the order will automatically expire on the next bar, so long as the condtions no longer exitst.
    More info at - http://www.ninjatrader-support.com/H...tml?Overview36

    However, you can use IOrders to track and cancel orders...



    Asdie from that if you want to see how orders are being submitted or expiring, you can use TraceOrders - http://www.ninjatrader.com/support/f...ead.php?t=3627
    TimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    666 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    377 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X