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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X