Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

hundreds of thousands of error messages, ¿how can i permanently get rid of them?

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

    hundreds of thousands of error messages, ¿how can i permanently get rid of them?



    people with nt,


    i'm trying to automate a strategy but it won't make entries and exits when the conditions dictate that it should.


    i have tried to automate the same strategy from a strategies tab in the control center but nothing. i have also inserted it into a chart and enabled the strategy in both cases but then nt won't open the position that my strategy calls for.


    this led me to check the log and i found more than half a million of these moronic messages just for today. ¿how can i cancel all erroneous orders for good and get rid of these messages as well?

    9/30/2019 13:55 Default Strategy 'temagghmaperranfmod/-1': An order placed at '31-Jul-17 06:39:43' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.
    9/30/2019 13:55 Default Strategy 'temagghmaperranfmod/-1': An order placed at '31-Jul-17 06:39:43' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.
    9/30/2019 13:55 Default Strategy 'temagghmaperranfmod/-1': An order placed at '31-Jul-17 06:39:43' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.
    9/30/2019 7:11 Default Strategy 'temagghmaperranftecnted5mod/-1': An order placed at '05-May-19 19:00:05' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.
    9/30/2019 7:11 Default Strategy 'temagghmaperranftecnted5mod/-1': An order placed at '05-May-19 19:00:05' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.
    9/30/2019 7:11 Default Strategy 'temagghmaperranftecnted5mod/-1': An order placed at '05-May-19 19:00:05' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.

    very well, thanks, regards.

    #2
    Hello rtwave,

    Thanks for your post.

    As you can see the strategy when applied to historical data will process your strategy and will place historical orders up to the bar that first connects to real time data. If your strategy has an historical order open and the start behavior is using the default of "wait until flat" start behavior, then the strategy name in the strategy tab will remain a yellow color indicating it is waiting to complete its historical order. Please see: " Understanding the strategies tab" https://ninjatrader.com/support/help...tegies_tab.htm

    The error messages are advising the your strategy is placing orders (and the BarsRequiredToTrade setting is causing the strategy to ignore them) before the property "BarsRequiredToTrade" has been met. You can eliminate those errors by adding a check at the top of OnBarUpdate() to see if the current bar is less than or equal the BarsRequiredToTrade and if so to "return" (meaning no further processing below the line until the the strategy processes a bar that is greater then BarsRequiredToTrade. For example if (CurrentBar[0] <= BarsRequiredToTrade) return; Reference: https://ninjatrader.com/support/help...redtotrade.htm
    Last edited by NinjaTrader_PaulH; 09-30-2019, 12:33 PM. Reason: grammer adjusted.4
    Paul H.NinjaTrader Customer Service

    Comment


      #3



      Paul,



      thanks.


      your suggestion worked to get rid of the deluge of error messages.


      there is just one small error in the line you suggested, the correct syntax is:


      if (CurrentBars[0] <= BarsRequiredToTrade) return;


      this is the first time i have been using nt to automate strategies and after some minor difficulties i'm getting much better results now. thanks again.

      Comment


        #4
        Hello rtwave,

        Thanks for your reply.

        If you are using the strategy builder to generate the code then it will always use CurrentBars[] to cover all cases of 1 data series (Chart bars) or added data series.

        The use of CurrentBar or CurrentBars[0] is interchangeable when you only have one data series (the chart bars). If your strategy has multiple data series then you must use CurrentBars[n] where "n" would be the different data series.

        References:

        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CortexZenUSA, Today, 12:53 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        2 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,262 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X