Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Closing positions once gain/loss target set

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

    Closing positions once gain/loss target set

    I have desperately been trying to figure this one out. I am new to strategy trading so I still lack a good knowledge of NinjaTrader strategy creation. However, I am wanting to construct what I believe to be a very simply strategy but cant seem to figure out how:

    I am wanting to program a strategy that will close all open positions as soon as my unrealized gains in my account reach a certain target or hit a certain stop. Thats it, nothing more. Can someone please advise. It would be greatly appreciated!

    #2
    Hello,

    I suggest storing your entry price then tracking price as it changes using GetCurrentBid() or GetCurrentAsk() to understand where your open position is in profitability.
    DenNinjaTrader Customer Service

    Comment


      #3
      Ben, Thanks for the response. Could you give me some more detailed info. as far as how to write a strategy that would accomplish this? I dont know where to begin as far as the structuring of an automated strategy. Thanks.

      Comment


        #4
        Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=4084
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        66 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X