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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    50 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    16 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X