Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

opening orders

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

    opening orders

    Hello guys!

    I'm new to ninjascript and I have a problem that might seem basic to most people here, but I read the documentation and tried everything I could but wasn't able to figure this out.

    I want to open an order and already tried with managed and unmanaged approach.
    The orders are sent, I got a fill confirmation on the OnExecution event but the orders are not being opened in the platform...

    This is a simulation account from optimusfutures.com using Rithmic.

    Here's the code and the logs from the OnExecution event

    managed

    entryOrder = EnterLong(1, "Enter Long" + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString());


    log from the OnExecution event

    Execution='NT-00000' Instrument='ES 06-12' Account='Sim101' Name='Enter Long9282' Exchange=Default Price=1374,5 Quantity=1 Market position=Long Commission=0 Order='NT-00000' Time='09/04/2012 08:31:40 p.m.'

    Execution='NT-00001' Instrument='ES 06-12' Account='Sim101' Name='Exit on close' Exchange=Default Price=1356,75 Quantity=1 Market position=Short Commission=0 Order='NT-00001' Time='10/04/2012 08:15:00 p.m.'

    -------------------------------------------------------------

    unmanaged

    entryOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Market, 1, 0, 0, "", "Enter Long"+ DateTime.Now.Second .ToString() + DateTime.Now.Millisecond.ToString() );

    log from the OnExecution event
    Execution='NT-00000' Instrument='ES 06-12' Account='Sim101' Name='Enter Long35512' Exchange=Default Price=1374,5 Quantity=1 Market position=Long Commission=0 Order='NT-00000' Time='09/04/2012 08:31:40 p.m.'

    Execution='NT-00001' Instrument='ES 06-12' Account='Sim101' Name='Exit on close' Exchange=Default Price=1356,75 Quantity=1 Market position=Short Commission=0 Order='NT-00001' Time='10/04/2012 08:15:00 p.m.'


    Any help is really appreciated. Thanks!

    #2
    Hello pablobentancor,
    Welcome to the forum and I am happy to assist you.

    You are submitting the orders in the Simulator account (Sim101). To send the order to your borkers account please make sure you have live license key and you have selected your brokers account name in the Strategy parameters.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks a lot for your quick reply.

      All I have is the simulated account, that's the only account shown in the accounts tab, and the only one available in the strategy parameters.

      However, shouldn't I be able to see my trades sent to this sim account?
      I mean in the platform as if I submitted them manually....

      Thanks again for helping me.

      Comment


        #4
        Hello pablobentancor,
        You can find all the orders in the Orders tab in Control Center http://www.ninjatrader.com/support/h...orders_tab.htm
        You can find all the executed trades in the Execution tab in Control Center http://www.ninjatrader.com/support/h...utions_tab.htm

        You can also see the trades on the chart, depending on how you have set the Plot executions property. Please refer to this YouTube video which demonstrates it http://www.ninjatrader.com/support/h...utions_tab.htm

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thank you.

          Yes, I'm familiar with the orders and executions tabs but the orders are not shown there. Only the ones I submit manually from the platform are displayed there, but not the ones sent through ninjascript. Is that normal?

          Comment


            #6
            Hello pablobentancor,
            Are the orders results from a backtest? If so then they will not show up in Control Center.

            Also I could see the trades are for previous dates.
            Execution='NT-00000' Instrument='ES 06-12' Account='Sim101' Name='Enter Long35512' Exchange=Default Price=1374,5 Quantity=1 Market position=Long Commission=0 Order='NT-00000' Time='09/04/2012 08:31:40 p.m.'

            Execution='NT-00001' Instrument='ES 06-12' Account='Sim101' Name='Exit on close' Exchange=Default Price=1356,75 Quantity=1 Market position=Short Commission=0 Order='NT-00001' Time='10/04/2012 08:15:00 p.m.'
            The Order/Execution tab displays the orders/trades for the current day only.

            You can find the historical trades (not backtest trades) from the Account Performance tab in the Control Center.


            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Thank you.

              I assumed that I was trading live but you are right, time stamps are old like if it was a back test.

              Comment


                #8
                Hello pablobentancor,
                Thanks for your note.
                Please let me know if I can assist you any further.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  According to what you can see in that screenshot I'm running a live test, right?

                  If I print the Close[0] price I get the current market prices so I think this is not historical... but still orders seem to be filled and don't appear on the live orders/execution tabs...

                  Should I try other broker?
                  Any suggestion for me to try?

                  Thanks a lot for your support.

                  Comment


                    #10
                    One more thing, the timestamps seem old and very different from each other, but one order was submitted only a couple of minutes later than the other.

                    Comment


                      #11
                      Hello pablobentancor,
                      The orders are submitted in the historical bars. Orders which are submitted on historical bars are simulated only and are not sent to your brokers account or show up in the orders tab or execution tabs.

                      If you do not wish to calculate it on historical bars please append the below code just below OnBarUpdate

                      Code:
                      protected override void OnBarUpdate()
                      {
                         if (Historical) return;
                         /rest of the code
                      }


                      Please let me know if I can assist you any further.
                      JoydeepNinjaTrader Customer Service

                      Comment


                        #12
                        That worked excellent. Thank you very much!

                        Comment


                          #13
                          Hello pablobentrancor,
                          Glad you could solve the issue.
                          Please let me know if I can assist you any further.
                          JoydeepNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by PaulMohn, Today, 12:36 PM
                          2 responses
                          16 views
                          0 likes
                          Last Post PaulMohn  
                          Started by Conceptzx, 10-11-2022, 06:38 AM
                          2 responses
                          53 views
                          0 likes
                          Last Post PhillT
                          by PhillT
                           
                          Started by Kaledus, Today, 01:29 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post Kaledus
                          by Kaledus
                           
                          Started by yertle, Yesterday, 08:38 AM
                          8 responses
                          37 views
                          0 likes
                          Last Post ryjoga
                          by ryjoga
                           
                          Started by rdtdale, Today, 01:02 PM
                          1 response
                          6 views
                          0 likes
                          Last Post NinjaTrader_LuisH  
                          Working...
                          X