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 AaronKoRn, Today, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      10 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      11 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,980 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X