Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error - sell order on session beginning

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

    Error - sell order on session beginning

    Hi,

    Today I cought Ninja when triggering on session beginning - I set "session begins" on 9:55AM, in that minute "out of nowhere" order was submited (see attachment). Others orders are fine but the first one.
    Simple strategy was used: buy/sell on SMA(3) and SMA(14) crossovers.


    So, the question is:
    why does it happen and how to avoid it in future?

    I am on NT 6.5.1000.7, XP Sp3.

    Best Regards
    Attached Files

    #2
    Hello,

    This has do with strategy vs. account position. This link will help:


    Also, go to Tools>Options>Strategies tab>NinjaScript tab, and check Wait until flat before executing live.
    DenNinjaTrader Customer Service

    Comment


      #3
      Hi Ben,

      Thanks for quick reply.

      "Wait until flat before executing live" was checked. It always is.

      As I understood, every time I set "session begins" later than 9:30 and in the meantime condition was done (say simple Sma(3) crossbelow Sma(14), like it happend today), strategy position would be Long or Short (Short in my todays case). For me it should not trigger no matter what strategy position is, am I right?

      Comment


        #4
        The way it works is as follows Kowal.

        You start your strategy at 9:30. Say you have a strategy position of 100 long. With "Wait until flat" you will continue to maintain this virtual position of 100L. Your account position should be flat. As data comes in and your strategy evaluates its trade conditions, when it finally reaches an exit order that brings you flat then you will make a live trade after that.

        These are the scenarios you may find yourself in:
        1. ExitLong() triggered. Next trade = live
        2. EnterShort() triggered. The close position part will be virtual, the obtaining of a short position will be live

        If you are experiencing differently please clarify.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh,

          thanks for reply - now I know a little bit more.
          Ok, so lets take a look at an attached chart from my first post. At 9:51 there is a crossover (Sma(3) below Sma(14)) - now, strategy position is short, profit trigger was set to 12 ticks so at 9:55 -when I want my strategy to start working - strategy position should be flat. There is no reason to trigger at that time. Or I am missing sth.

          Comment


            #6
            Let us take a step back. How are you starting your strategy?
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Control Center/ Strategies/ New Strategy/
              NQ, 1 Minute
              Session begins - 9:55AM
              Calculate on bar close - true
              Entries per directon - 1
              Entry handling - AllEntries
              Stop&Target submission - PerEntryExecution

              Comment


                #8
                Please try the SampleMACrossOver strategy with "Wait until flat" selected in the same manner you are right now. If the SampleMACrossOver does not submit an order like the one you observed than we will need to dive into your strategy to see what is happening from that end.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Josh,

                  I did few tests on Market Replay Data using SampleMACrossOver strategy with "Wait until flat" checked.
                  Some "days" everything works like it should. Just beautifull. Some "days"...well, it doesnt. I attach some charts to illustrate what I mean.
                  Attached Files

                  Comment


                    #10
                    Hello,

                    What are the MA settings for the strategy? Are they the same as the SMA's you have on the chart in the screen shots?

                    Can you provide the exact steps you are taking to produce this?

                    Also, please post your replay data file.
                    DenNinjaTrader Customer Service

                    Comment


                      #11
                      Hi,

                      I used SampleMACrossOver strategy to "produce" these charts, SMAs settings are 10 and 25 (default) and yes, they are the same as SMAs in attached screen shots.
                      I am not sure what You mean writing about exact steps. Strategy settings? Control Center/ Strategies tab/ New Strategy - here they are:
                      (I would sent a screen shot, but I couldnt do that on PC, sorry)

                      Strategy: SampleMACrossOver
                      Parameters
                      Fast: 10
                      Slow: 25
                      Data Series
                      Instrument: ES 12-08
                      Type: Minute
                      Value: 1
                      Time Frame
                      Exclude weekend: False
                      Session begins (local time): is on every screen shot
                      Session ends (local time): 3:00PM
                      General
                      Account Sim101
                      Calculate on bar close: true
                      Label: SampleMACrossOver
                      Min. bars required: 20
                      HistoricalFillProcessing
                      Fill type: Default
                      Slippage: 0
                      Order Handling
                      Entries per direction: 1
                      Entry handling: AllEntries
                      Exit on close: True
                      Exit on close seconds: 30
                      Stop & target submission: PerEntryExecution
                      Order Properties
                      Set order quantity: by strategy
                      Time in force: Gtc

                      I sent an email to subscriber-support at ninjatrader dot com, subject "data replay file - att BEN".

                      Comment


                        #12
                        Ups, she did that again.

                        SampleMACrossOver strategy
                        Sessions begins (local time): 10:30AM
                        Attached Files

                        Comment


                          #13
                          Hello,

                          I will take a look at this when your email comes in with your data and get back to you with more information.
                          DenNinjaTrader Customer Service

                          Comment


                            #14
                            Kowal,

                            We have not received your mail yet. If you don't mind could you try resending? Thank you.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Kowal,

                              I know what is happening here. I suspect you are running on a 24hr chart. This means your indicators are running based off of the 24hr data set. When you change your strategy to start at 9:55AM you are now using a different data set. To see your trades you want to go to your chart properties and change the session begin/end time to correspond with your strategy's start/end time. In this manner you will be able to see correct data set and then match up your trades.

                              If you are trying to use a time filter to limit trading instead you want to see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3226
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,604 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              8 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
                              4 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              13 views
                              0 likes
                              Last Post Javierw.ok  
                              Working...
                              X