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

Strategy Builder - Max daily loss and max profit stops

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

    Strategy Builder - Max daily loss and max profit stops

    Hi,

    I am using the Strategy Builder to build a strategy and run into some issues while trying to define a max daily loss and max profit. How do I use the builder to create a condition in which it stops trading if I reach a predetermined max daily loss or profit (which I can enter as input so they can be selected each time)?

    Also, is there a way to set a limit on the number of daily trades? Something like a trade count that will prevent the strategy from executing more trades if a predefined limit is reached?

    Thanks
    David

    #2
    Hello David, thanks for writing in.

    We have a reference sample here demonstrating how to hold a strategy once a certain cumulative profit is reached:

    https://ninjatrader.com/support/help...nce_user_d.htm

    The StopStrategy method can not be called from the builder, so you will need to incorporate this condition in your entry order conditions. Something like

    if(condition to trade && SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit < 1000 || SystemPerformance.AllTrades.Tra desPerformance.Currency.CumProfit > -400)
    {
    //perform the trade.
    }

    You would need to unlock the script and write by hand to count the number of trades that happened, that can not be done from the builder.

    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Chris,

      Thanks!

      If I unlock the script and make changes by hand as suggested above, will I be able to go back and continue with the Builder or will I be on my own at that point?

      Thanks
      David

      Comment


        #4
        Hello David, thanks for your reply.

        The script would not be editable in the builder after unlocking, it must be coded by hand after unlocking.

        Kind regards.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        11 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        7 views
        0 likes
        Last Post elirion
        by elirion
         
        Working...
        X