Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Mutiple entries not working in strategy develpment

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

  • NinjaTrader_ChelseaB
    replied
    Hello im197,

    What is the high and low of the 11:01 PM bar (or whatever the next bar is)?

    What happens to the order in the prints to the output window of the order object or on the Orders display in the Strategy Analyzer?

    To save the output from the output window, right-click the output window -> select Save As.

    Leave a comment:


  • im197
    replied
    Hi Chelsea,

    the order @ 13:00 on 5/23/2019 was rejected because the price is no longer applicable.

    The candle that ends at 13:00 closed lower than the stop price that was submitted @ 23:00 the previous night.

    The order was a sell short on stop @ 3325 and was not executed.

    5/22/2019 11:00:00 PM Strategy 'ATRTrailStrat/-1': Entered internal SubmitOrderManaged() method at 5/22/2019 11:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=3325 SignalName='Short 1' FromEntrySignal=''
    Market going up, trail stop @ 3325

    I am asking why it was not executed.



    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello im197,

    So.. Is the order submitted at 11:00 or 13:00?

    Are you asking about the ignored message?

    5/23/2019 1:00:00 PM Strategy 'ATRTrailStrat/-1': Ignored SubmitOrderManaged() method at 5/23/2019 1:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=3325 SignalName='Short 1' FromEntrySignal='' Reason='Invalid order price, please see log tab'

    Leave a comment:


  • im197
    replied
    Hi Chelsea,

    this is what I see in the date the 1st skip is observed

    5/22/2019 11:00:00 PM Strategy 'ATRTrailStrat/-1': Entered internal SubmitOrderManaged() method at 5/22/2019 11:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=3325 SignalName='Short 1' FromEntrySignal=''
    Market going up, trail stop @ 3325
    5/23/2019 1:00:00 PM Strategy 'ATRTrailStrat/-1': Entered internal SubmitOrderManaged() method at 5/23/2019 1:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=3325 SignalName='Short 1' FromEntrySignal=''
    5/23/2019 1:00:00 PM Strategy 'ATRTrailStrat/-1': Ignored SubmitOrderManaged() method at 5/23/2019 1:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=3325 SignalName='Short 1' FromEntrySignal='' Reason='Invalid order price, please see log tab'
    Market going up, trail stop @ 3325

    I have attached the code.

    I am running this on strategy analyzer on FESX 240 mins from 1/1/2019 to today, with default settings, with exit on session close to false. I am sure you can replicate it.
    Attached Files
    Last edited by im197; 10-02-2019, 09:15 AM.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello im197,

    Lets focus on a specific order.

    At what time is the order submitted?

    Do you see the order submission in the TraceOrders?

    What happens to the order in the prints to the output window of the order object or on the Orders display in the Strategy Analyzer?

    To save the output from the output window, right-click the output window -> select Save As.

    Leave a comment:


  • im197
    replied
    Hello Chelsea,

    I set up order trace to true and I don't see any orders being rejected. I am submitting the 2nd order after the 1st one has been executed.

    I am not submitting a stop order for any of the positions as I expect the stop and reverse to take place with the initial enter on stop order.

    I attach the strategy code.

    Looking forward to an eventual solution

    Attached Files

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Ioannis,

    Do you have trace orders enabled and are you printing the order object or looking at the orders tab?

    Are the orders being submitted?

    Are the orders being cancelled or rejected?

    Are you submitting a market order after the first stop order fills?

    Leave a comment:


  • im197
    replied
    Hello Chelsea,

    I have coded the strategy according to your instructions, by using OnExecutionUpdate to submit the 2nd order in sequence and indeed the 2nd order submits fine.

    Now I have the problem that the strategy occasionally skips the stop and reverse initial order so it sometimes keeps the initial position through the stop price! As I go through the trades, the stop level is respected by the strategy only after target for the 1st order is hit - i.e. it is only applied to the 2nd entry.

    I have attached photos of the skips.

    Perhaps advise why.

    rgds

    Ioannis
    Last edited by im197; 10-02-2019, 06:23 AM.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Ioannis,

    Our development has let us know they are deeming this expected and have updated the help guide to reflect this.

    "-A position is open and two or more Entry methods to reverse the position are entered together. In this case the second Entry order will be ignored."
    https://ninjatrader.com/support/help...antedPositions

    The work around would be to wait until the first entry fills and then submit the second entry in OnOrderUpdate() or OnExecutionUpdate() (or on the next OnBarUpdate()).

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Ioannis,

    If it does turn out to be expected, you may need to wait until the first working order fills before placing the second.

    Or use the unmanaged approach.

    Once I have more information I will let you know.

    Leave a comment:


  • im197
    replied
    Hello Chelsea,

    assuming it is an "expected behavior" what would be the way around the problem?

    There surely must be a way to code this simple strategy .

    Regards

    Ioannis

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Ioannis,

    This is still being discussed between our support and our development to determine if the behavior is expected due to the internal order handling rules.

    "Methods that generate orders to enter a position will be ignored if: A position is open and an order submitted by a non market order exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction."

    I apologize for the amount of time it is taking to resolve this inquiry and I really do appreciate your patience.
    Last edited by NinjaTrader_ChelseaB; 09-11-2019, 09:14 AM.

    Leave a comment:


  • im197
    replied
    Hello,

    more than 20 days have passed, since the last message from support. Do we have an update? I suppose it is a programming issue with the platform?

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Ioannis,

    I'm still looking into this and I've forwarded an inquiry to our development as I'm not seeing the order is ignored from TraceOrders, nor do I see the order initialized in OnOrderUpdate().

    I will keep you in on the loop once I have more information.

    I appreciate your patience.

    Leave a comment:


  • im197
    replied
    Any updates on the support side on why the platform is not working as it should? Still waiting for an answer !

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by PaulMohn, Today, 03:49 AM
0 responses
7 views
0 likes
Last Post PaulMohn  
Started by inanazsocial, Today, 01:15 AM
1 response
9 views
0 likes
Last Post NinjaTrader_Jason  
Started by rocketman7, Today, 02:12 AM
0 responses
10 views
0 likes
Last Post rocketman7  
Started by dustydbayer, Today, 01:59 AM
0 responses
4 views
0 likes
Last Post dustydbayer  
Started by trilliantrader, 04-18-2024, 08:16 AM
5 responses
23 views
0 likes
Last Post trilliantrader  
Working...
X