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
    BertrandNinjaTrader Customer Service

    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
        BertrandNinjaTrader Customer Service

        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 frslvr, 04-11-2024, 07:26 AM
          6 responses
          105 views
          1 like
          Last Post NinjaTrader_BrandonH  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          6 responses
          26 views
          0 likes
          Last Post trilliantrader  
          Started by arvidvanstaey, Yesterday, 02:19 PM
          5 responses
          14 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Started by Rapine Heihei, Yesterday, 08:25 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Mongo, Yesterday, 11:05 AM
          6 responses
          27 views
          0 likes
          Last Post Mongo
          by Mongo
           
          Working...
          X