Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

The strategy just disables automatically without messages (replay mode)

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

    The strategy just disables automatically without messages (replay mode)

    I have created a new strategy that I try to test on Replay mode, however when I enabled the strategy it goes disabled (the enable check goes uncheck automatically) after 1 second.
    • No log messages
    • Just a few messages printed in the Output window (exaclty 384 bars)
    • The replay instrument is BTCUSD from 15/04/2023
    • I have done Replay tests with other strategies without issues


    Click image for larger version

Name:	enabled uncheck.jpg
Views:	118
Size:	31.3 KB
ID:	1251702
    Click image for larger version

Name:	output.jpg
Views:	101
Size:	161.7 KB
ID:	1251703
    Click image for larger version

Name:	btcusd.jpg
Views:	102
Size:	78.1 KB
ID:	1251704

    I will appreciate any help

    Thank you,

    #2
    Hello Lalocom,

    Are you seeing any errors in the control center log tab? If no errors are listed at all I would suggest trying to run the strategy in other modes like a backtest or realtime to see if the same happens where you can't start the strategy. If so at that point you would very likely need to reduce the strategies code by commenting it out so you can find a point where it lets it enable. That would allow you to find what specifically is causing that to happen. In most cases when a strategy disables like that there will be a error in the control center log tab.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      No error messages in the control center log tab. As a matter of fact, no new messages appear after running in replay mode.

      Trying in backtest mode doesn't give me any error messages either but there are at least some messages (see the image below).

      Click image for larger version

Name:	log messages.jpg
Views:	114
Size:	75.7 KB
ID:	1251749

      Besides, I don't get any trade in the backtest window. I am testing with BTCUSD from 01.01.2023 to 16.05.2023 in 1 min TF.

      In the output window, I'm printing some data for each bar, like time.

      Click image for larger version

Name:	output2.jpg
Views:	101
Size:	145.6 KB
ID:	1251750

      I'm going to reduce the code as you proposed and see what I get.

      Thanks you,
      Lalocom



      Comment


        #4
        Hello Lalocom,

        That output appears to be similar to your first image so it looks like in playback the strategy also was processing. If you are using TickReplay or have a lot of tick data loading its possible that its just taking a while to enable while it processes. Are you giving it some time after clicking enable? Also please try enabling the strategy from the chart to check if it lists the name with a (D) next to it in the top left.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,

          I found it !!!!

          It was as silly as setting the contracts number to 0 in this sentence,

          Code:
          SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Market, nc, 0, 0, "", "EnterLong");
          Thanks for your help,
          Lalocom

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,406 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          98 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          8 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          160 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          9 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X