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 CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          21 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          120 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          175 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          92 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          134 views
          0 likes
          Last Post cmoran13  
          Working...
          X