Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged order failing and still submitting exit orders

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

    Unmanaged order failing and still submitting exit orders

    I wrote a bare-bones strategy as I wanted to see if I could move stop and limit orders from a Managed strategy using chart trader....

    Having some problems. It says that I don't have enough bars to trade, despite having set "BarsRequiredToTrade" to zero. I just need the strategy to open a position immediately.

    But the biggest issue, is that despite Ninjatrader failing to open the position, it submits the Stop and limit orders anyway, meaning those will enter a position when they get hit!

    It's supposed to be a managed order approach and yet cannot manage to not submit exit orders when the entry has failed?!



    HTML Code:
    Strategy 'OrdersTest/96107680': An order placed at '18/01/2017 22:01:00' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.
    Enabling NinjaScript strategy 'OrdersTest/96107680' : On starting a real-time strategy - StartBehavior=ImmediatelySubmit EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=True / triggering 30 seconds before close SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On bar close IsUnmanaged=False MaxRestarts=4 in 5 minutes
    NinjaScript strategy 'OrdersTest/96107680' submitting order
    NinjaScript strategy 'OrdersTest/96107680' submitting order
    Attached Files

    #2
    Hello reach4thelasers, and thank you for your question.

    When I compiled and ran your strategy directly on my system, it worked without error. When I reviewed your code, however, I noticed this was a locked strategy with code manually added to it. When I loaded this code up into the strategy wizard, it erased all your existing code.

    I believe what may be occurring may be related to the hidden XML overwriting your settings, and restoring your BarsRequiredToTrade to 20.

    The easiest way to alleviate this, if you are ready to edit your code by hand, is to unlock your strategy using the "unlock code" button in the lower left. Otherwise, if you would prefer your code remain locked so that you can continue editing it through the strategy wizard, you will need to hand-edit the XML at the bottom, as well as your code, every time you make a code change.

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,967 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    4 views
    0 likes
    Last Post rbeckmann05  
    Started by rhyminkevin, Today, 04:58 PM
    4 responses
    55 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Started by iceman2018, Today, 05:07 PM
    0 responses
    6 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    8 views
    0 likes
    Last Post lightsun47  
    Working...
    X