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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          37 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, Yesterday, 02:41 AM
          0 responses
          17 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          25 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          34 views
          0 likes
          Last Post CarlTrading  
          Working...
          X