Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simultaneously Entering two Long positions with OCO

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

    #16
    Hello AlexAOM,

    I am not able to open that google spreadsheet file.

    Please note, with NinjaScript related items, we find that working through email is best for our Scripting Support department. This gives our Support team time to research and test your inquiry to ensure we have the best information available for you.

    Due to our support policy, we are not able to provide one on one educational services for NinjaScript over the phone. We are not able to provide assistance with debugging over the phone. We are not able to provide assistance with building a strategy in the Strategy Builder over the phone.

    Through email, we can provide demonstration example scripts for you to import and learn from. Links to educational material in the help guide and videos. For the Strategy Builder we can provide steps and direction, sample code, and video demonstrations of any specific action in the Strategy Builder. We are also able to guide you through the debugging process to assist or building process of a specific script you are wanting to work out.

    As a further benefit, writing your questions out in email and getting responses back in email allows you to keep that information saved in your email for future reference.

    Over the phone, we can answer general questions about NinjaScript methods and properties documented in the help guide as wells as explain tools and pages of the Strategy Builder, but we specifically cannot provide personalized education sessions, hands on development or with using the Strategy Builder to add code, or hands on debugging assistance over the phone.

    Scripting Support inquires in particular can easily exceed standard call times and affects our ability to assist others. We appreciate your understanding in this matter.​

    Comment


      #17
      Hi Gaby,
      Let me clarify the misunderstanding.
      I did not ask you to teach me over the phone. I was hoping to review my findings over the phone since NinjaTrader does not allow the posting of Excel files.
      I was hoping to share my screen and point out the exact location in the trace where the problem occurred.
      The data in the spreadsheet is a subset of the Out data with my comments.
      You can see that the strategy generates unsolicited Target and Stop orders.
      As I mentioned in my previous post, this happens only when placing 2 limit orders where each order has a corresponding set of Target and Stop.
      I have exhausted my test cases and feel that it might be a bug.
      Since I can not post the spreadsheet as is, I converted it to CSV format. See attached.
      All my color coding and pictures have disappeared but you can see my comments tagged as //.
      Also, you may want to run the snippet code to experience the issue firsthand. It is consistent!
      Thanks,
      Alex​
      Attached Files

      Comment


        #18
        Hello AlexAOM,

        Analyzing the log and/or output is considered debugging assistance / personalized education assistance. Unfortunately, our support team cannot assist with this over the phone.

        We can only answer general questions about NinjaScript methods and properties documented in the help guide as well as explain tools and pages of the Strategy Builder, but we specifically cannot provide personalized education sessions, hands on development, or hands on debugging assistance over the phone.

        Looking at the provided information, it could be due to your StopTargetHandling setting which is currently set to StopTargetHandling.ByStrategyPosition. Using ByStrategyPosition can result in more than the position quantity. From the Help Guide:

        "If you would prefer all of your stops and targets to be placed at the same time within the same order, it is suggested to use StopTargetHandling.ByStrategyPosition. However this may result in more stop and target orders being submitted than the overall strategy position in a scenario in which the strategy's entire entry orders are not filled in one fill."



        Try switching this to StopTargetHandling.PerEntryExecution - are you seeing the same result?

        I'm not seeing anything in this output or spreadsheet that definitively suggests a bug is occurring at this time. If a bug is occurring, we would need a reduced version of the script that only contains the necessary code to demonstrate the error, as well as descriptive debugging prints that clearly demonstrate orders are being placed when the logic in the script suggests otherwise.

        Comment


          #19
          Hi Gaby,
          I changed StopTargetHandling.ByStrategyPosition to StopTargetHandling.PerEntryExecution and it works now as anticipated.
          Appreciate your patience.
          Thanks a lot.
          Alex

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          53 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X