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 LawrenHom, Today, 10:45 PM
      0 responses
      3 views
      0 likes
      Last Post LawrenHom  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      44 views
      0 likes
      Last Post bill2023  
      Working...
      X