Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strange end of Wizard based Strategy

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

    Strange end of Wizard based Strategy

    A Wizard based strategy with a Stoploss & Profittarget order. The stoploss and profittarget are OCO to the initial trade. I have a conditionset to exit the order under certain conditions. However this exit is taking a new trade in stead of exiting the old trade, requiring more margin than available on the account.

    When I look at the code it is:
    if ( ConditionSet2)
    EnterShort(DefaultQuantity, "SH");

    if ( ConditionSet4)
    ExitShort("SHexit", "SH");

    What could cause this to go wrong?

    #2
    clint2008, I'm not sure I follow, the ExitShort would only bring your current short position flat and not open a new one, however if you want to reverse from being long to short with 1 contract, it would need 2 contracts to accomplish that (one for the exit, one for the new position). So this could be what you see, in either case, please ensure you're synched up properly - http://www.ninjatrader-support.com/H...tPosition.html

    Comment


      #3
      thanks for the reply, I was hoping it would flatted my position, but its not. First I thought it was because of not stating an entrylabel, but that does not matter. Now I have the entrylabel and still on the wrong side of the market at the end. have I got any other options to investigate what is going on there? I've looked at the orders, executions and tracefile, but did not find a reason why it doesn't exit the initial trade. Could the missing DefaultQuantity on the exitshort have an effect?

      Comment


        #4
        No, if you your ExitShort would exit the complete position as referenced by your Entryname. I'd suggest working with trace orders to check the behavior of your orders - http://www.ninjatrader-support2.com/...ead.php?t=3627

        Which 'On starting a realtime strategy' option are you using under Tools > Options > Strategies > NinjaScript? - http://www.ninjatrader-support.com/H...tegiesTab.html

        Comment


          #5
          Wait until flat caused the problem probably, now it is checked it didn't give me a new position. Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          89 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          48 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          31 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          34 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          69 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X