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 yertle, Yesterday, 08:38 AM
        7 responses
        28 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        5 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X