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 traderqz, Today, 12:06 AM
        8 responses
        14 views
        0 likes
        Last Post traderqz  
        Started by SightCareAubetter, Today, 12:50 PM
        0 responses
        1 view
        0 likes
        Last Post SightCareAubetter  
        Started by Mongo, Today, 11:05 AM
        4 responses
        14 views
        0 likes
        Last Post Mongo
        by Mongo
         
        Started by Skifree, Today, 03:41 AM
        5 responses
        13 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by traderqz, Yesterday, 09:06 AM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X