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 Fitspressorest, Today, 01:38 PM
      0 responses
      2 views
      0 likes
      Last Post Fitspressorest  
      Started by Jonker, Today, 01:19 PM
      0 responses
      1 view
      0 likes
      Last Post Jonker
      by Jonker
       
      Started by futtrader, Today, 01:16 PM
      0 responses
      5 views
      0 likes
      Last Post futtrader  
      Started by Segwin, 05-07-2018, 02:15 PM
      14 responses
      1,791 views
      0 likes
      Last Post aligator  
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      844 views
      0 likes
      Last Post emuns
      by emuns
       
      Working...
      X