• 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

Using ATI functions within NinjaScript

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

    Using ATI functions within NinjaScript

    Hello,
    I want to implement money management rules into automated trading over several strategies.Therefore I have started the creation of a centralized "RiskManager" class in the "UserDefinedMethods.cs" file.

    Currently I am working on implementing the basic functionality provided by the class. I'd like to have a function "isConnected()" giving me back the state of my broker connection (e.g. as boolean value). Furthermore I want to access strategy relevant information.

    By searching the forums and help I found the "ATI DLL Interface Functions" most suitable for providing the desired functionality. Especially following functions are of interest to me:
    PHP Code:
    int Command(stringcommandstringaccountstringinstrumentstringactionintquantitystringorderTypedoublelimitPricedoublestopPricestringtimeInForcestringocostringorderIdstringstrategystringstrategyId)
     
    int Connected(intshowMessage
    string Strategies(stringaccount
    int StrategyPosition(stringstrategyId
    How can I use these functions within the "normal" NinjaScript? If I can't, how would I substitute the above mentioned functions?

    #2
    Hello PadanKane,

    Thank you for your post.

    The function int Command() submits, cancels, or changes orders. These functions are readily available through the Strategy namespace in NinjaScript, but cannot be accessed through the UserDefinedMethods.cs file for the strategies. Please visit the following link for the functions and methods available for strategies in NinjaScript: http://www.ninjatrader.com/support/h...7/strategy.htm

    int Connected would be OnConnectionStatus in the strategies and indicators: http://www.ninjatrader.com/support/h...tionstatus.htm

    string Strategies() would pull the ATM Strategies of the account referenced, in NinjaScript this is not available. You would need to reference the ATM Strategies Id, but the ATM Strategy would need to be sent from the NinjaScript strategy. You can find information on this item at the following link: http://www.ninjatrader.com/support/h...tionstatus.htm
    An example of using ATM Strategies in your code can be found by going to Tools --> Edit NinjaScript --> Strategy --> SampleAtmStrategy.

    int StrategyPosition() would be the same as GetAtmStrategyMarketPosition() in NinjaScript: http://www.ninjatrader.com/support/h...etposition.htm

    The UserDefinedMethods are used to create your own methods to be used across strategies or indicators, but the functions and methods of the strategies and indicators are not available in the UserDefinedMethods nor are the DLL Functions. Information on the UserDefinedMethods can be found at the following link: http://www.ninjatrader.com/support/h...ed_methods.htm

    Please let me know if I may be of further assistance.
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rickyblah12, Today, 09:57 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by pecunianonolet, 11-28-2016, 03:34 AM
    4 responses
    3,136 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by contrax, Today, 08:20 AM
    2 responses
    12 views
    0 likes
    Last Post contrax
    by contrax
     
    Started by brownsfan019, Today, 07:54 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by Amitabha, Today, 04:50 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Marco  
    Working...
    X