Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Question

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

    Strategy Builder Question

    Like most strategies I have one that relies on some string of events. I'm trying to debug this but putting each event in a separate tab in the conditions section and using print when it occurs. However is there a way to increment a variable or something so that when each condition tab is true the trade will execute? I hope that makes sense.

    #2
    Hello synthhokie,

    When using the builder you can use a custom series as a counter, you can find an example of that concept here: https://forum.ninjatrader.com/forum/...er#post1099186

    Comment


      #3
      I've used the example to attempt to do what I'm after but I am having issues. What is the best way to upload my strategy builder strategy for you to look at?

      Comment


        #4
        Hello synthhokie,

        You can use the export function to make a zip file and then attach that with your reply.

        Comment


          #5
          What I would like to do is have each condition add to a counter and when counter = X it executes a trade. The problem I have is when 1 condition happens multiple times before another and adds a bunch to the counter. Is there someway to prevent that? You'll see what I tried to do unsuccessfully. The RSI condition for instance doesn't seem to be working. Also the drawings I'm creating it seems to only use the last drawing when looking at it in the analyzer afterwards rather than showing all the instances of the event. Thank you for your help!
          Attached Files

          Comment


            #6
            Hello synthhokie,

            In the attached script your first condition or Set 1 will only happen 1 time on the first bar to set a default value. The code in set 2 is always executed to collect the count from the previous bar and apply it to the series.

            Are you seeing entries placed to know that the last set is working? As you have it now you could see that the conditions all become true at the same time, for example if your set 3 becomes true the series is set to 1, set 4 is now checked and the series equals 1 so it can happen immediately. The samee would go for the last set, once the count is 3 it will execute an reset it.

            For the drawings you need to add the CurrentBar to the Tag when configuring drawing objects to make them unique. If the same tag is re used it updates the existing object.

            Another way to approach this would be to just use bool variables since you are not counting something with an unknown limit. For example you could make a bool variable for each set and if the set is true seet the variable to true. In the last set check if all variables you created are true.

            Comment


              #7
              The bool variable seems way less fiddly. That is a great idea. I am seeing entries placed so that part is working. It looks like I somehow mixed condition 4 and 5 but that said let me try the Bool method. I'll post back if I have issues with that.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              23 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              120 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              63 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              45 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X