Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

disable trades based on pnl

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

    disable trades based on pnl

    Hi, I current have written an addon for nt8 and would like to add the following functionality:

    1. If my realized pnl for the day is -$300 disabled all future orders
    2. Limit the total number of contracts to a specific number (i.e. 2 contracts)

    Is this possible using an addon?

    #2
    Hello trader252,

    Thank you for the post.

    This would be possible depending on the scope you are referring to.

    You could disable the addon from trading or the placing of orders through its logic, but there is no way to globally control the platform to prevent other tools from placing orders. If you instead mean to control this globally this would be something you would need to watch yourself and then just stop trading if you shouldn't be trading at that point. An automated script could use the PnL information to prevent its self from trading in its logic, you can also do this in an addons logic for the trades it places.

    The limit to the contracts would also be up to your logic and your tool, this is not something you could globally control but you could certainly limit your add-on using its code.



    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      Can you provide some insight on what the automated script would look like that use the PnL information and how to reference it within an existing strategy code? a sample would be great. thanks in advance

      Comment


        #4
        Hello duoshark,

        Welcome to the NinjaTrader support forum.

        You can find reference samples for different trading concepts in the following link: https://ninjatrader.com/support/help...ce_samples.htm
        The strategy section has some samples related to trading concepts like PnL: https://ninjatrader.com/support/help...nce_statis.htm

        I would also suggest any follow-up questions that you may have on this subject it would be best for you to make a new thread for those questions so we don't reopen the original posters question.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by aa731, Today, 02:54 AM
        0 responses
        5 views
        0 likes
        Last Post aa731
        by aa731
         
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        11 views
        0 likes
        Last Post Christopher_R  
        Working...
        X