Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

An order has been ignored since the stop price ‘13080.75’ near the bar stamped

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

    An order has been ignored since the stop price ‘13080.75’ near the bar stamped

    hi, i have a problem with the logic of historical orderfill process maybe someone can help me with a concrete example? after hours of research on this topic i can't come up with a solution
    Here is a concrete example (Calculate = Calculate.OnBarClose):
    a second data series added for orderfill: AddDataSeries(BarsPeriodType.Tick, 1);

    Code:
    stopPrice = RoundToTickSize(stopPrice > Bars.GetOpen(CurrentBar + 1) ? stopPrice : Bars.GetOpen(CurrentBar + 1) + TickSizeValue);
    
    SubmitOrderUnmanaged(1, OrderAction.BuyToCover, OrderType.StopMarket, bracket1Qty, stopPrice, stopPrice, oco1, signalName1);
    entry short @ 12777.50 stop filled @ 12782.75 (1. trade is done) all good
    2. entry short @ 12782.75 stop @ 12782.75 ???

    the stop is at the same price as the askprice which logically becomes a problem. my question now is how can i adjust the stop price for the historical part of the strategy so that if it is equal to or higher than the askprice it is automatically set to askprice + 1 tick?
    I am only concerned with the State.Historical mode, the State.Realtime is clear to me.

    Click image for larger version

Name:	Screenshot_1.jpg
Views:	265
Size:	42.6 KB
ID:	1148093Click image for larger version

Name:	Screenshot_2.jpg
Views:	221
Size:	31.8 KB
ID:	1148095Click image for larger version

Name:	Screenshot_3.jpg
Views:	241
Size:	25.9 KB
ID:	1148094
    Click image for larger version

Name:	Screenshot_4.jpg
Views:	226
Size:	108.7 KB
ID:	1148096
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    Thank you for your post.

    You'd need to use Tick Replay to get historical bid and ask prices. GetCurrentAsk() and GetCurrentBid() return the close price on historical data, so you can't just use those. There's an example of how to get historical bid/ask prices using Tick Replay here:



    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Hi _Kate, is there also a solution without TickReplay? and what would it look like?
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      Comment


        #4
        Hello sidlercom80,

        Thank you for your reply.

        You could try adding single tick ask/bid series to your strategy and referencing that for the historical ask price and then add a tick to that. This won't necessarily be as accurate as using tick replay, but would work for historical calculations:



        Please let us know if we may be of further assistance to you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        94 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        139 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        124 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        74 views
        0 likes
        Last Post PaulMohn  
        Working...
        X