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

Strategy builder bug

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

    Strategy builder bug

    On the latest build, and I''ve had this in quite a few different scenarios the last few days, if you create a strategy using something like the below, the strategy builder cannot process it. It always says it cannot save it due to an XML error.

    Code example below, as output by the strategy builder.

    Code will compile and run in the editor fine, which is OK, if you no longer want to use the builder...

    Code:
    			if (BarsInProgress != 0) 
    				return;
    
    			if (CurrentBars[0] < 3)
    			return;
    
    			 // Set 1
    			if ((Close[2] > DonchianChannel1.Mean[0])
    				 && (Close[1] < DonchianChannel1.Mean[0])
    				 && (Close[3] < DonchianChannel1.Mean[0]))
    			{
    				EnterLong(Convert.ToInt32(2), "");
    				ExitLongLimit(Convert.ToInt32(1), (DonchianChannel1.Upper[0] + (-4 * TickSize)) , @"", "");
    				ExitLongLimit(Convert.ToInt32(1), (Position.AveragePrice + (3 * TickSize)) , "", "");
    			}

    #2
    Hello PJSmith,

    Thank you for your note.

    After you’ve created this strategy in the strategy builder, are you unlocking the strategy? Or are you getting this issue from these inputs in the strategy builder?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      The strategy was entirely in the strategy builder at the time the error occurs. I only unlocked the strategy afterwards as the strategy builder could not save the built strategy. This at least enabled me to see the code, make any changes I needed in the editor, and share the code here.

      I've actually had this a few times on different days/strategies I've tried to build. I think it may be related to positive or negative offsets in targets, but that's a guess. If you unlock the code, it'll compile and run fine in the editor, so I guess it's just the strategy building struggling to parse/save the xml.

      Comment


        #4
        Hello pjsmith,

        I set up the strategy with the information you provided and was unable to replicate.

        Can you confirm the screen shot of the attached should result in the error?

        I look forward to your reply.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,609 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        16 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X