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

Cannot set Limit and Stop Prices for unmanaged order submitted

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

    Cannot set Limit and Stop Prices for unmanaged order submitted

    Hello,

    In NT7, for some reason i am not being able to set the limit and stop price for unmanaged orders. I have the following scripts and the order is entered successfully. However the Limit and Stop prices of the order show as zero. Can anyone help me determine why? I couldn't find the answer anywhere in this forum.

    Thank you!

    Under Initialize()...
    Unmanaged = true;

    Under OnBarUpdate()...
    entry1 = SubmitOrder(0, OrderAction.Buy, OrderType.Market, 1, 47.90, 42.90, "", en);

    Output window...
    Order='221b6a2b2b9d48df96da3c525999665c/Replay101' Name='Entry 1' State=Filled Instrument='CL 09-17' Action=Buy Limit price=0 Stop price=0 Quantity=1 Strategy='Auto Entry V1.0' Type=Market Tif=Gtc Oco='' Filled=1 Fill price=46.24 Token='221b6a2b2b9d48df96da3c525999665c' Gtd='12/1/2099 12:00:00 AM'

    #2
    Hello caiobran,

    Market orders cannot have a stop or limit price so these are not used.

    If you want to set both the stop and the limit, then you need a StopLimit as the order type.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Wow, that was an easy fix. Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,606 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      15 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X