Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

close at new high

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

    close at new high

    Hi ninja trader community,

    I need your help. How do I tell this strategy to close its position high(e.g if trading at 3300 close at 3305 etc)? This strategy is based on an indicator. So if I'm taking a long and the next few candles go short the strategy's signal will close its position in a loss but is there way I could tell the strategy to not close its position in the state of a loss but to look for a new high and close its position in that new high?

    Thank you
    Attached Files

    #2
    Hello Titli,

    You can submit an order to a specific price. A buy limit would be below the ask, a sell limit would be above the ask, a buy stop would be above the bid, a sell stop would be below the bid.

    You can get the High with High[barsAgo index].

    You can add ticks to the high with TickSize.

    For example

    EnterLongLimit(High[0] + 3 * TickSize);

    You can compare the current price to the close of 3 bars ago.

    if (Close[0] > High[3])
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you so much Chelsea. You are always such a great help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X