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 ct, 05-07-2023, 12:31 PM
        6 responses
        202 views
        0 likes
        Last Post wisconsinpat  
        Started by kaywai, Today, 06:26 AM
        0 responses
        1 view
        0 likes
        Last Post kaywai
        by kaywai
         
        Started by kevinenergy, 02-17-2023, 12:42 PM
        118 responses
        2,778 views
        1 like
        Last Post kevinenergy  
        Started by briansaul, Today, 05:31 AM
        0 responses
        9 views
        0 likes
        Last Post briansaul  
        Started by traderqz, Yesterday, 12:06 AM
        11 responses
        28 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X