Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Global Stoploss and Profit Target

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

    Global Stoploss and Profit Target

    I want a global profit target and stop loss.

    I want a strategy that monitors all positions --- profits and losses—regardless or manual entry or strategy entry and will auto sell/flatten when these targets are hit. It will trigger Regardless of the order entry method, If I enter them manually or anything. Kind of a global target loss and target profit for the day. We can assume one instrument or across all interments. I don’t care. I need a place to start.



    Allowable Loss (Global Stop Loss)
    Allowable Profit (Global Daily Profit Target)

    Any C# code to do this within Ninjatrader????????????

    Thanks

    #2
    You'd need to keep track of the P&L of all strategies within a .txt file (or any other kind of external file), and then have each strategy read from that.

    Comment


      #3
      Hello knightravine,

      Thank you for your note.

      In this case using the idea posted by Radical you can use the following reference sample to read and write to a text file: http://www.ninjatrader.com/support/f...ead.php?t=3477

      Otherwise this is outside the supported methods of NinjaScript.

      Please let me know if I may be of further assistance.

      Comment


        #4
        Thanks Radical. Elegant. 10 years as a C# programmer! and I did not think of making an external data source like txt or xml! I can even output a html based dashboard. This will be helpful on multiple levels including multi-time frame support to output resistance or pivots etc. and use across strategies/indicators.

        Thanks PatrickH for the code sample.

        I am so glad I posted my question.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        39 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X