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 algospoke, Yesterday, 06:40 PM
      2 responses
      19 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      45 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      20 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      180 views
      0 likes
      Last Post jeronymite  
      Working...
      X