Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sumulated Trading?

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

    Sumulated Trading?

    I am using Yahoo as my datasource for some daily strategy simulation testing.

    I have Market Analyzer filtering my Instrument list for the stocks I want to trade (pic1).

    I right click each row and choose send to chart, then I change the chart from Min to Day, then I add my strategy. It seems to be placing some of the limit orders to be executed in the morning, but some fail (pic2).

    Will the working limit order highlighted in green get placed when the market opens in the morning (pic2)?

    What is wrong with the other charts why do they get this error how do I fix it?

    Thanks,
    Erik
    Attached Files

    #2
    Some more info on the issue below. I restarted NT, reconnected to yahoo, made an instrument list from the Instruments in the list below (pic1 previous post below) Reopened Market Analyzer and added just the instrument list with the missing data and now all of the data appears to be there (pic3) and the orders are placed (pic4). If I close Market Analzyer and try to import my original Instrument list I still get the missing data. and the charts that will not trade the strategy.
    Attached Files

    Comment


      #3
      Erik, this is expected you need to get data access for the instruments you wish to simulate trading on, the old instrument list seems to contain instruments where you're not receiving data for. Please try to open a chart for those and check if / which error is shown then in the Log tab of the Control Center.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Will the working limit order highlighted in green get placed when the market opens in the morning? How exactly does this simulation mode work?

        I looks like the orders have been submitted to the account and it is just a matter of weather my limits get hit during the day or not. Is this correct?

        Thanks,
        Erik

        Comment


          #5
          Erik, this is correct those limits orders are submitted and waiting for a fill - if you don't resubmit or set them to liveUntilCancelled they would expire after one bar - http://www.ninjatrader-support.com/H...verview36.html
          BertrandNinjaTrader Customer Service

          Comment


            #6
            I will be using MB Trading as my broker after I finish simulation testing of my strategies. I was reading the MB Trading API documentation and forums and their support states that if you are going to submit limit orders via their api you can do them at anytime, but if you are going to submit market orders you need to do that during traiding hours.

            Since I will not be using their api directly to submit the orders I will be using NT. My ExitLong orders will be market orders will I need to follow these rules for entering the orders, or since I will be using NT will I be able to submit the Market sell orders the evening before?

            Thanks,
            Erik

            Comment


              #7
              Hi Erik, are you on daily data? Then your market orders would be submitted as the OnBarUpdate is called the next morning, so it should not be an issue then.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                I have not shut down or modify anything in NT since last night so the images below are still valid.

                Question:

                if you look at (pic4 in the posts below) you will notice that ZRAN has a working limit order from last night

                I look at my chart for ZRAN this morning and the 7/28 bar has started to paint.

                I am using the following code to place orders:

                protectedvirtualvoid MyEnterLongLimit(double limitPrice, string signalName) {

                DrawSquare("My square" + CurrentBar, 0, Highs[0][0] + 3 * TickSize, Color.DodgerBlue);

                EnterLongLimit(
                0, false, GetNumSharesToBuy(), limitPrice, signalName);
                }

                So if my strategy trys to place an order I get a square drawn on my chart.

                My ZRAN chart has a blue square on the 7/27 bar and on the 7/28 bar, but I have no changes to the working orders.

                1. Is this because I have CalculateOnBarClose = false and Entries per direction set to 1?

                If in fact 7/27 entry conditions and 7/28 entry conditions both "say place order" I would like a working order placed for tomorrow via 7/28 criteria and limit price if the current working order from 7/27 does not get filled. Will this be the case?

                Thanks,
                Erik

                Comment


                  #9
                  Erik,

                  It depends how you do this. If you are using same signal names you will simply amend your original order. If you want a whole new order, use a different signal name.

                  I suggest you use TraceOrders = true in Initialize() to understand what your orders are doing.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    I have TraceOrders = true from back testing I get something like this:

                    6/22/2009 12:00:00 AM Entered internal PlaceOrder() method at 6/22/2009 12:00:00 AM: Action=Buy OrderType=Limit Quantity=100 LimitPrice=9.59 StopPrice=0 SignalName='' FromEntrySignal=''
                    6/22/2009 12:00:00 AM ZRAN EnterLongLimit 100 9.5855 A02_TwoPeriodCombinedRSIBuyer(11,55,95,1,0,0,0,0,0 ,0,0,0,0,0,0)
                    6/23/2009 12:00:00 AM Entered internal PlaceOrder() method at 6/23/2009 12:00:00 AM: Action=Buy OrderType=Limit Quantity=100 LimitPrice=9.48 StopPrice=0 SignalName='' FromEntrySignal=''
                    6/23/2009 12:00:00 AM Amended open order: Action=Buy OrderType=Limit Quantity=100 LimitPrice=9.48 StopPrice=0 SignalName=Buy' FromEntrySignal=''
                    6/23/2009 12:00:00 AM ZRAN EnterLongLimit 100 9.481 A02_TwoPeriodCombinedRSIBuyer(11,55,95,1,0,0,0,0,0 ,0,0,0,0,0,0)
                    6/24/2009 12:00:00 AM Entered internal PlaceOrder() method at 6/24/2009 12:00:00 AM: Action=Buy OrderType=Limit Quantity=100 LimitPrice=9.56 StopPrice=0 SignalName='' FromEntrySignal=''
                    6/24/2009 12:00:00 AM Amended open order: Action=Buy OrderType=Limit Quantity=100 LimitPrice=9.56 StopPrice=0 SignalName=Buy' FromEntrySignal=''
                    6/24/2009 12:00:00 AM ZRAN EnterLongLimit 100 9.557 A02_TwoPeriodCombinedRSIBuyer(11,55,95,1,0,0,0,0,0 ,0,0,0,0,0,0)
                    6/25/2009 12:00:00 AM Cancelled expired order: BarsInProgress=0: Order='NT-00000/Back101' Name='Buy' State=Working Instrument='ZRAN' Action=Buy Limit price=9.56 Stop price=0 Quantity=100 Strategy='A02_TwoPeriodCombinedRSIBuyer' Type=Limit Tif=Day Oco='' Filled=0 Fill price=0 Token='c65b57869f7d4cbcab66b5b2aecb2ff7' Gtd='12/1/2099 12:00:00 AM'

                    So in this example I amended my order a few times and then finally the order was canceled because it did not get filled.

                    Is this correct?

                    And this is the way I should expect it to act live vs. back testing?

                    In my situation below my 7/27 order has already been amended by the 7/28 order and if I would have had the output window open I would have seen this?

                    Is there a way for me to setup some sort of .net tace listener to output this to a file or is it already logged somewhere if I forget to open the output window?

                    Thanks,
                    Erik

                    Comment


                      #11
                      That is correct it gets amended. The differences from live vs backtesting would not come from this.

                      If you want to output to a text file you will need to explicitly program your strategy to do so. Please see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3475
                      Josh P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Mizzouman1, Today, 07:35 AM
                      3 responses
                      17 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by RubenCazorla, Today, 09:07 AM
                      2 responses
                      13 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by i019945nj, 12-14-2023, 06:41 AM
                      7 responses
                      82 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by timmbbo, 07-05-2023, 10:21 PM
                      4 responses
                      158 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by tkaboris, Today, 08:01 AM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X