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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        77 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        45 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        27 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X