Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting Max Daily Loss in Strategy Wizard

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

    Setting Max Daily Loss in Strategy Wizard

    Folks,
    After weeks of unsuccessful coding, I have built my strategy completely through the Strategy Wizard, all except one aspect. I'm looking to have the Strategy Wizard not enter into any new trades once my max daily loss is reached. I'm only dealing with one market, one set of contracts in and out. I tried setting up the following conditions with my buy-ins:
    A: Realized PNL (currency) <= -1000 (backtest comes back all 0's)
    B: Realized PNL (currency) >= -1000 (backtest shows several days where a number trades were made later in the day well after $1000 in losses where realized)
    Does anyone know of another option? And just to make it harder, anything that can be done within the Wizard? (it's been a nightmare coding/compiling, etc. that I'd rather not take any chances unlocking code). Please advise.
    Thanks

    #2
    Hello Decoda,

    Thank you for your post.

    How are you stopping the strategy when this condition is true in the wizard?

    Are you printing out the values when the condition is true?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Cal,
      Thank you for the quick reply.
      I thought the logic didn't seem right, but what I was trying to do was:
      If Realized PNL is less than/equal to -$1000, make trade. (True)
      So if it's greater than -$1000 (False), all conditions weren't met and trade shouldn't be made.
      When I got back all zero's from the backtest I figured that statement was preventing it from making any trades.
      Then I reversed it to greater than (thinking the wizard is seeing positive and negative numbers the same way in their distance from zero), but the backtest disregarded the rule and continued trading after $1000 in the day's losses.
      I haven't been printing out the value when the conditions are true. I just go through the trades tab of the backtester results to view where the daily drawdowns exceed $1000 and if more trades are made that day.
      Hope this helps.

      Comment


        #4
        Decoda,

        Would you mind attaching your strategy so I can review it?

        Your strategy is located in (My) documents -> NinjaTrader 7 -> bin -> Custom -> Strategy

        To attach, Click Reply -> Go Advanced -> Click the Paperclip Icon in the toolbar
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Cal,
          Here it is, thanks again.
          Attached Files

          Comment


            #6
            Decoda,

            I don't see any instance in the strategy were you are checking for -1000 against the Cumulative Profit.

            You can setup the strategy to use the this check and then change a variable value to ensure the other if statements are not true, just like you are doing with Variable0
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Cal,
              It's Condition #6 of sets 3 and 6. You have to scroll down to see it.

              Comment


                #8
                Decoda,

                Those are not checking for loss's but rather a positive PnL
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Cal,
                  Is there a way to check against losses or negative PnL?
                  Thanks

                  Comment


                    #10
                    Hello decoda,

                    Thank you for your response.

                    You would use a negative value for the Numeric Value.
                    Attached Files

                    Comment


                      #11
                      Patrick,
                      Thanks for the reply. Unfortunately, I had tried that condition and the backtest returned all zeros. When I remove the condition it worked fine. I even tried Realized PnL >= -1000 but the strategy still traded beyond the1000 max in daily realized losses. Just to double check, I'm putting as a condition for my buy-in's to prevent any new trades being initiated. Any other options?

                      Comment


                        #12
                        Hello decoda,

                        Thank you for your response.

                        That is correct. Please provide a screenshot of the full condition in the Conditions and Actions window that you are currently using after adding what I suggested.

                        Comment


                          #13
                          Patrick,
                          Will do but I got a dumb question, how do I capture a screenshot of the conditions and actions window? No luck with the clicks; hot key?

                          Comment


                            #14
                            Hello,

                            To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and upload the file as an attachment to your next forum response.


                            For detailed instructions please visit the following link
                            KyleNinjaTrader Customer Service

                            Comment


                              #15
                              Kyle,
                              Thanks for the info, here's the screenshot:
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by carnitron, Today, 08:42 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post carnitron  
                              Started by strategist007, Today, 07:51 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post strategist007  
                              Started by StockTrader88, 03-06-2021, 08:58 AM
                              44 responses
                              3,973 views
                              3 likes
                              Last Post jhudas88  
                              Started by rbeckmann05, Today, 06:48 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post rbeckmann05  
                              Started by rhyminkevin, Today, 04:58 PM
                              4 responses
                              58 views
                              0 likes
                              Last Post dp8282
                              by dp8282
                               
                              Working...
                              X