• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access to ATI server in script

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

    Access to ATI server in script

    In NT7 I use the following example code to run the ATI server from a script to place various orders, the example is an order to buy or sell, I realize this is not documented in NT7 but is there a documented version in NT8 or can you tell me how to access a reference to the ATI server?


    Code:
    private string CreatePlaceOrder(string account, string strategyTemplateName, OrderAction action, int quantity, OrderType orderType, string orderId, double limitPrice, double stopPrice)
            {
                string commandStringOIF = CommandString("PLACE",
                                                        account,
                                                        Instrument.FullName,
                                                        action.ToString(),
                                                        quantity,
                                                        orderType.ToString(),
                                                        limitPrice,
                                                        stopPrice,
                                                        TimeInForce.Day.ToString(),
                                                        "",
                                                        orderId,
                                                        strategyTemplateName,
                                                        "");
                
                NinjaTrader.Server.AtiServer atiServer = NinjaTrader.Cbi.Globals.AtiServer;
                MethodInfo miProcessOif = typeof(NinjaTrader.Server.AtiServer).GetMethod( "ProcessOif", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Static );
                if( miProcessOif != null )
                {    object[] args = { commandStringOIF };
                    miProcessOif.Invoke( null, args );
                }
                return commandStringOIF;
            }

    #2
    Hello seahn,

    Thank you for your post.

    There would not be documentation for this in NinjaTrader 7 or 8. This would be considered unsupported programming in NinjaScript. I would not be aware of a means to achieve the same results in NinjaTrader 8.

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by seahn View Post
      In NT7 I use the following example code to run the ATI server from a script to place various orders, the example is an order to buy or sell, I realize this is not documented in NT7 but is there a documented version in NT8 or can you tell me how to access a reference to the ATI server?
      I believe that ati server code was being used in NT7 to overcome it's inability to place an order attached to an ATM within an indicator..

      NT8 has changed and opened up that a bit..

      You might try referencing the StartAtmStrategy() now instead..

      http://ninjatrader.com/support/helpG...tmstrategy.htm


      -=Edge=-
      NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Bouzayen, Today, 08:31 PM
      0 responses
      9 views
      0 likes
      Last Post Bouzayen  
      Started by IanC28, 03-27-2020, 10:20 AM
      6 responses
      28 views
      0 likes
      Last Post jim1234
      by jim1234
       
      Started by aramtrader, Yesterday, 03:05 PM
      7 responses
      38 views
      0 likes
      Last Post woodie1
      by woodie1
       
      Started by renehtx, Today, 03:51 PM
      2 responses
      16 views
      0 likes
      Last Post renehtx
      by renehtx
       
      Started by eidog2020, Today, 03:31 PM
      0 responses
      7 views
      0 likes
      Last Post eidog2020  
      Working...
      X