Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stopping entering trades after consecutive losers

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

    Stopping entering trades after consecutive losers

    Hi there, I need help with this, I think it might be something simple but I was unable to find answers to this topic.
    I want a strategy to stop entering for the rest of the day after two consecutive losses.
    I found this:

    but I was unable to load the strategy in the strategy builder in order to analyze it.

    #2
    Hello Joaqvil,

    Thank you for your post.

    The link you provided is for an unlocked strategy created in the NinjaScript Editor. A version of this strategy does not exist for the Strategy Builder; due to the limitations of the Strategy Builder's capabilities, such as not being able to perform arithmetic on variables, not being able to code a loop, and not having access to the SystemPerformance.AllTrades collection, this strategy may not be reproduced via the Strategy Builder.

    Math may be done with custom series values in the Strategy Builder. You may be able to achieve your desired result by using two custom series, one for the strategy's total PnL and another for the PnL after the previous trade was exited, though performing mathematical calculations with a custom series goes beyond the scope of support we offer for the Strategy Builder. The "DailyLossLimitBuilderExample_NT8" performs math with custom series if you'd like to take a look at how it could be done:
    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader


    Since you want the strategy to stop entering after two consecutive losses, you could try working with bools after the first loss, then after the seconds loss, and then to stop your strategy from trading. Here is an example of triggering bools for a later action in the Strategy Builder:
    Hi, To improve a strategy, I would like the condition to enter a trade to be triggered only after a second crossing happens. Meaning, for instance we have a sthocastics crossing, but the strategy would only trigger when a crossing between 2 emas happen. Would the looking back N bars work? Can it be done within the builder


    Ultimately, what you are looking to achieve is much more simple via an unlocked script like the example you linked. In the Strategy Builder, you have to push the limits of its intended abilities and use workarounds to get a similar result.

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thinking about working around this in a simpler way, I was wondering if is it possible to create an imaginary line at the price the enter was made, and then make a condition to stop reentering that day if the price goes 10 points below the entering price (the stop loss).

      Comment


        #4
        Hello Joaqvil,

        Thank you for your reply.

        Rather than an imaginary line, you could create a double variable on the "Inputs and Variables" screen of the builder:


        You can set up a Condition and Action set that saves the value of the entry price plus/minus 10 points of loss. You can then finally have a condition that checks if the Close price goes above/below the saved price, and if so set a bool to stop trading. The entry conditions should check that bool's value in order to enter. I have created a video demonstrating these ideas and attached the example strategy I made in the video. You can go to Control Center > Tools > Import > NinjaScript AddOn to import the example and view it in your own Strategy Builder.

        Video link: https://www.screencast.com/t/C5CX4mWN

        Please let me know if you have any additional questions or concerns.
        Attached Files

        Comment


          #5
          I'm just glad I ended in your hands, thanks for taking the time of making the video

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          86 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          151 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          79 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          53 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          60 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X