Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pending Order end billion of Cancel order

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

    Pending Order end billion of Cancel order

    Hi guys,
    i've an issue for manage the cancel of an order that is not filled in a normal time:

    Code:
    private void checkIsPendingOrderInMarket(){			
    			if (this.entryOrder != null && CurrentBar > this.barNumberOfOrder + orderLifeLimit)
    			{				
    				if(logEnabled) printLogFile("Cancel Order", false);
    				CancelOrder(this.entryOrder);
    				isLaunchedOrderButNotDetected = false;
    			}
    		}
    but this code generate on Log a billion of rows.. "Cancel Order"... after a submission of an order...

    any idea?

    thanks to alls!

    wyatt

    #2
    wyatt, where do you place/work with this snippet in your strategy code? Could the too high # of log entries be the result of working CalculateOnBarClose = false?

    Comment


      #3
      i put this in OnBarUpdate() method...

      CalculateOnBarClose is False, the number isn't a billion, but is one row at second...

      Comment


        #4
        Could be the case, as then it would print a row every tick as long as this condition is 'true -

        if (this.entryOrder != null && CurrentBar > this.barNumberOfOrder + orderLifeLimit)

        Comment


          #5
          the problem could be the CurrentBar?

          when i start a strategy overnight (when a market isn't started) currentbar take a high number (and not zero as is espected)... there is a variable that i take for check when i want start my strategy? (examples: i want start at 20th bar from point when i start the strategy?)

          Comment


            #6
            Yes, that could be it Wyatt - do you need the logging on historical data? If not then a check with the historical property below could help log only the realtime seen actions from the strategy -

            Comment


              #7
              thanks Bertrand!

              so, if i put this code (if (historical) return;...) at the start of my strategy, work with real time data? in this mode, i hope that CurrentBar take a low number...

              another example is VWAP..

              when i START my strategy,it try to take a value in the past (like VWAP().VwapLine[15]) and for don't get an exception i put prior a control of the size of VWAP

              Code:
              if ( VWAP.VwapLine.Count < 15 ) return; 
              else variable= VWAP().VwapLine[15];
              .. but this doesn't work! and return me an exception OutOfBound or OutOfRange (i don't remember) beacause the Count is a high number!

              Comment


                #8
                The CurrentBar count seen would be unaffected - it starts from the left most bar of the chart and increases until you're at the last bar currently processed on the very right side - you might want to look into the Bars.BarsSinceSession property, it would be reset on session break and increase bar by bar for the session only.

                For the VWAP check, please use a CurrentBars check at the top of the OnBarUpdate() instead so you would not run into accessing bars that are not available yet at the OnBarUpdate() start for CurrentBar = 0.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                647 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X