Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait for last trade to close

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

    Wait for last trade to close

    Hi everyone!
    I'm currently learning to develop strategies using NT8 so far everything is going well and I'm getting used to ninja platform very quick, maybe because of my previous experience developing robots for the fx market. But one thing I don't understand and already tried to find a solution in the forum is that every time I run a strategy on backtest or live (on demo) the strategy closes the last trade if a new signal in the opposite direction is created, so it will show on the chart as position closed (or something similar, I can't remember). So my question is how can I do for the strategy to wait for the last trade to be closed by the take profit or stop loss before opening any other, is there any option during the strategy builder I should click on maybe?
    Thanks.
    Last edited by natanrodriguezspn; 11-06-2017, 09:09 AM.

    #2
    Hello natanrodriguezspn,

    Welcome to the NinjaTrader forums!

    There would be a few options. Below are publicly available links.

    You could detect that an exit order has filled in OnExecution or OnOrderUpdate and trigger then entry in the opposite direction after the exit has filled.
    https://ninjatrader.com/support/help...tionupdate.htm
    https://ninjatrader.com/support/help...rderupdate.htm

    You could also detect that the position has has changed in OnPositionUpdate and if the position is flat, place an order in the opposite direction.
    https://ninjatrader.com/support/help...tionupdate.htm

    In OnBarUpdate you could also add to the condition that places the order in the opposite direction that the position is flat before allowing the opposite entry to be placed.
    https://ninjatrader.com/support/help...etposition.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Franck Z, Today, 09:49 AM
    0 responses
    5 views
    0 likes
    Last Post Franck Z  
    Started by pvtrader, Today, 08:02 AM
    2 responses
    7 views
    0 likes
    Last Post pvtrader  
    Started by Natoc, Today, 03:04 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by Rudy2323, Today, 02:56 AM
    2 responses
    28 views
    0 likes
    Last Post Rudy2323  
    Started by tonynt, Yesterday, 02:07 PM
    1 response
    38 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X