Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 mattbsea, Today, 05:44 PM
      0 responses
      3 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      31 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      2 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,282 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      20 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Working...
      X