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 NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X