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 WiseAmo, Today, 04:34 PM
        1 response
        10 views
        0 likes
        Last Post aseef
        by aseef
         
        Started by kiddads, Today, 05:23 PM
        0 responses
        2 views
        0 likes
        Last Post kiddads
        by kiddads
         
        Started by gtheaded, Today, 04:38 PM
        0 responses
        10 views
        0 likes
        Last Post gtheaded  
        Started by trader252, Today, 04:34 PM
        0 responses
        14 views
        0 likes
        Last Post trader252  
        Started by Don22Trader1, Today, 04:20 PM
        0 responses
        9 views
        0 likes
        Last Post Don22Trader1  
        Working...
        X