Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy in NT8 with 1 minute granularity on the 15 minute graph don't work correctly

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

    #16
    Hi svopex,

    Just to confirm, this is in historical data correct?

    A Buy Stop Market order must be placed above the current ask.
    A Sell Stop Market order must be placed below the current bid.

    What I am seeing is this, the FIRST_ ORDER order is placed at 565.4 on the 4:15 bar.

    The order doesn't fill at 565.4 though it fills at 577.

    Then the stop is attempted to be placed at 573.7 (calculated from the fill of the entry), however, the bid price is still 558.4 (from the previous minute bar's close price) and this causes the stop to be rejected.

    I will have to look a little further into what prices are being used for these order fills and why this order was rejected.

    However, the prints and information you have given are extremely helpful in determining where the issue is.

    I will need to do further testing and I will get back to you.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Hi svopex,

      Also, if you were to check the current bid price and place the order under that bid price, the order is not going to be rejected. On the next price update you can always move it up.

      This is my suggestion from post #11 and will still work in this case. However, I will look further into what prices are being used to fill an order placed to a secondary minute time frame using the same instrument.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Hi Chelsea,

        ok, thank, I 100% understand. But...

        But is there way to create stoploss at the same time when it is filled first order?
        At price 573.7... At the same time, not after (for example) one minute when price updated...
        Trading without a stop loss is not good and with far stoploss is not good too.
        If NinjaTrader 8 buy order immediately after the gap (by stopmarket order), I cannot instantly create near stoploss.
        It's not good. I use this principle in multiple strategies. ok.

        Interesting is, when I use as first order "buy market order" (instead of "buy stopmarket order"), stoploss order is immediately created... Why? It is illogical.

        And in Ninja Trader 7 this really worked. There is a change of corresponding functions.
        You can test it...

        Thanks Petr
        Last edited by svopex; 10-16-2015, 10:31 AM.

        Comment


          #19
          Hi Petr,

          If you want to know why using a Market order for the entry does not cause this issue, use a market order and then look at the prints that are created.

          What is the fill price of the market order, what is the current bid when the price for the stop is calculated, what is the newly calculated price?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Hello, thank you for your patience.

            What is the fill price of the market order? orderEntry.AverageFillPrice = 577
            What is the current bid when the price for the stop is calculated? GetCurrentBid() = 558.4
            What is the newly calculated price? stopLossOrderPrice = 573.7

            All prices are same, but second order now in state "working" and exception haven't thrown.That is not logical. Picture about situation and actual strategy you have in attachment.

            Here is detailed log:

            Disabling NinjaScript strategy 'SellStopMarketTestModified/56392770'

            ==========================================
            FIRST ORDER BUY MARKET
            ==========================================
            GetCurrentBid() = 558.4
            Time[0] = 5/26/2010 4:15:00 PM
            Close[0] = 558.4

            5/26/2010 4:15:00 PM Strategy 'SellStopMarketTestModified/56392770': Entered internal SubmitOrderUnmanaged() method at 5/26/2010 4:15:00 PM: BarsInProgress=1 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='FIRST_ORDER'
            ==========================================
            ==========================================
            STOPLOSSORDER
            ==========================================
            GetCurrentBid() = 558.4 > stopLossOrderPrice: 573.7
            Time[0] = 5/26/2010 4:15:00 PM
            Close[0] = 558.4
            TickSize = 0.1
            SL = 33
            orderEntry.AverageFillPrice = 577
            SL * TickSize = 3.3
            Instrument.MasterInstrument.RoundToTickSize(SL * TickSize) = 3.3
            stopLossOrderPrice = orderEntry.AverageFillPrice - Instrument.MasterInstrument.RoundToTickSize(SL * TickSize) = 573.7

            5/26/2010 4:15:00 PM Strategy 'SellStopMarketTestModified/56392770': Entered internal SubmitOrderUnmanaged() method at 5/26/2010 4:15:00 PM: BarsInProgress=1 Action=Sell OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=573.7 SignalName='STOPLOSS_ORDER'
            ==========================================
            orderId='NT-00001-24' account='Sim101' name='STOPLOSS_ORDER' orderState=Filled instrument='TF 12-15' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=573.7 quantity=1 tif=Gtc oco='' filled=1 averageFillPrice=573.7 id=-1 gtd='2099-12-01'

            Enabling NinjaScript strategy 'SellStopMarketTestModified/56392770' : On starting a real-time strategy - StartBehavior=WaitUntilFlat EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=False SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On each tick IsUnmanaged=True MaxRestarts=4 in 5 minutes
            Attached Files
            Last edited by svopex; 10-18-2015, 06:12 AM.

            Comment


              #21
              Hello ChelseaB, have you read my last post? Petr

              Comment


                #22
                Hi Petr,

                I have read your last post and looked at the output and I am able to see what in my mind shouldn't be happening.

                GetCurrentBid() = 558.4 > stopLossOrderPrice: 573.7
                Close[0] = 558.4

                5/26/2010 4:15:00 PM Strategy 'SellStopMarketTestModified/56392770': Entered internal SubmitOrderUnmanaged() method at 5/26/2010 4:15:00 PM: BarsInProgress=1 Action=Sell OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=573.7 SignalName='STOPLOSS_ORDER'

                This order should have been ignored in historical or rejected in real time as it is a sell stop market order placed above market.

                I'm still in the process of trying to reproduce this and my thoughts are that there may be something specific happening with the saved historical data. I'm manually modifying my historical data to test this theory.

                At this time I have nothing to report. If I can consistently reproduce I will let our development know about the behavior. If I am not able to reproduce I will schedule a call with you to do further testing on your end.

                I appreciate your patience while I work on this, however, keep in mind that our NT8 Beta is second in priority to support for NinjaTrader 7 but will be progressed on as resources are free.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Hi Petr,

                  I am still unable to reproduce even after modifying my data to try and replicate this.

                  Please send an email to platformsupport [at] ninjatrader [dot] com with a link to this forum thread.

                  I would like to get on your machine and take a look at the data and compare with mine to see if I can spot what is causing this.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Working...
                  X