Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Trades at one price

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

    Multiple Trades at one price

    Hello everyone,

    first of all, my strategy in the strategy builder already says, "only one trade per direction".

    And, the higher I go with the minutes in the chart, the more I get this error.

    Is there a way in the strategy builder to say him, he has to do one trade per 10 minutes or similar?
    Or can I really say at another option, that he has to do really one trade...?

    I searched in the forum about this topic but found nothing useful...sorry.

    Thank you very much,
    Andi

    #2
    Here is the error.
    Attached Files

    Comment


      #3
      Hello andi5385,

      Thanks for your post.

      Is your strategy being run on live data, replay data, or Strategy analyzer data?

      Is your strategy using Calculate.OnBarClose, Calculate.OnEachTick, or Calculate.OnpriceChange?

      Are you wanting to limit your trades to no more than 1 per bar?

      Comment


        #4
        Hello Paul,
        thank you for your quick answer.

        - My strategy runs on a live CQG-Connection in Global Simulation Mode
        - My strategy uses Calculate on each tick

        Perhaps this is the solution, to limit my trades to no more than 1 bar, how can I do that in the strategy builder?

        Have a good day,
        Andi

        Comment


          #5
          Hello andi5385,

          Thanks for your reply.

          Correct, Calculate.OnEachTick will cause your strategy conditions to be true many times per bar and as you have seen will submit more than intended orders. The strategy executes far faster than the time it takes for the orders to be transmitted/received and acknowledged by the exchange so the protective features of 'Entries per direction" will not help until the first order is acknowledged which in the case of Calculate.OnEachTick or Calculate.OnPriceChange, will too slow.

          You can limit the trades to one per bar by creating an int variable (for example named "EntryBar") and using it to test against the current bar as an entry condition. If they are the same then no entry occurs if they are different then that means no previous entry has occurred on that bar. As this is logic it will operate as quickly as your code.

          In each Entry set, add the condition Misc>Current bar, NOT equal, User Variables>EntryBar
          In each Entry set, add the action User Variable>Entry bar, click "set", select Misc>Curent bar - this assigns the current bar to the entry bar variable.

          Note: If you have multiple entry sets, you may want to create additional EntryBar int type variables (with different names) to keep things organized.

          Comment


            #6
            Paul, thank you very much. I will try this!

            Comment


              #7
              Sorry Paul, but after your Strategy Builder tipps, I already get the same error of multiple trades.
              Did I do something wrong?
              Please see the attached screenshots for infos, thank you very much.
              Attached Files

              Comment


                #8
                Hello andi5385,

                Thanks for your reply.

                You created the condition correctly. the issue is with the action.

                You have entrybar = entrybar and you want entrybar = CurrentBar as this is where you set the current bar to the entry bar on the very first order (on that bar).

                Comment


                  #9
                  Sorry Paul, I did something wrong in the actions. Attached you find the correct action, thank you very much for your great help! Now it works!
                  Attached Files

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  62 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  134 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  75 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  45 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  50 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X