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

Stop Order Rejected 4 ticks above the market? What am I missing

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

    Stop Order Rejected 4 ticks above the market? What am I missing


    HI folks,

    I am trying the better understand NT capabilities and how to correctly use them.


    Stop Order Rejected 4 ticks above the market?

    What am I missing? How do I fix this, avoid this in the future, etc.

    Thanks!

    -----------------------------------------

    Market Position SHORT

    Orders are UnManaged



    Market Price appears to range between 2996.5 and 2997.75 through this entire 'only microseconds long' series of transactions


    1. Filled the Short OCO Entry at 2996.5


    1. In OEU executed the following to update the oco stop as the order finally filled:

    The CODE:
    InitialStopDistance = 4;
    ChangeOrder(stopLossShort, execution.Order.Filled, 0, GetCurrentAsk(1) + InitialStopDistance * TickSize);


    2. NT8 reported the following and disabled the strategy.

    "Sim101, Stop price can't be changed below the market. affected Order: BuyToCover 6 StopMarket @ 3000.25



    =====

    Attachments:

    1. Simple screen snip of the attached spreadsheet
    - Blue rows show market price from original orders and the exit to close the position.
    - Light Grays are the Offending Stop Loss Change Order.
    - Green rows are the original entry order.

    2. The spreadsheet in the image is included in the zip file

    Attached Files
    Last edited by hedgeplay; 06-12-2020, 02:19 PM.

    #2
    Hi, thanks for your question.

    There should be some error checking before submitting the order. Making sure that this statement is at the price it should be will be important:

    Print(GetCurrentAsk(1) + InitialStopDistance * TickSize);

    Could you test the strategy again with this debug statement to confirm the price you are setting the order at compared to the current price?

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3

      Thanks Chris.

      Below is an example of one (yes just one) Print statement I have set on ChangeOrder calls in the wild-west of OBU.


      Have not needed these prints yet on that handy 'how to use unmanaged orders with PartFills' code from Jim in OEU but will set some up and to capture any repetitive events going forward. If any happen soon I will post that detail here.


      ------

      #0480 04:40:07:8579 From Strat: BASE Unmanaged Bar = 1712 - OBU bottom SHORT TRAILING Stop Loss Change Order PRE-SUMBIT ChangeOrder(StopLossShortTextOrderName, StopLossShortTextOrderName.Quantity = 6, 0, Close[1] = 3021.75 gcBID = 3021.5 gcASK = 3021.75 (TrailingStopNumberOfTicks * tickSizeSecondary) = 5 * 0.25 ); desiredTrailingStopLossPrice= 3026.75

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by inanazsocial, Today, 01:15 AM
      1 response
      5 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
      1 view
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      23 views
      0 likes
      Last Post trilliantrader  
      Started by Davidtowleii, Today, 12:15 AM
      0 responses
      3 views
      0 likes
      Last Post Davidtowleii  
      Working...
      X