• 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

'GetAtmStrategyMarketPosition' method error: ATM strategy

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

    'GetAtmStrategyMarketPosition' method error: ATM strategy

    According to the documentation, I should get a marketflat response instead of this error.
    'GetAtmStrategyMarketPosition' method error: ATM strategy ID 'a14d63f8bbf24672a1c7931bebdd3f80' does not exist

    GetAtmStrategyMarketPosition()
    Previous page Return to chapter overview Next page

    Needs Review: This topic is still under review by the NinjaTrader Product Management team. Information on this page is considered to be accurate, although is subject to change during the NinjaTrader 8 beta program.



    Definition

    Gets the current market position of the specified ATM Strategy. If the ATM Strategy does not exist then MarketPosition.Flat is returned.

    #2
    Hello junkone,

    Thank you for your post.

    You are correct that it needs review. If the ATM Strategy ID does not exist the method could not be called. Make sure the ATM Strategy ID is not set to null before trying to call it.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      To avoid error on Output window you have to check first if an ATMstrategy is open with atmStrategyId.Length, just the same as the sample file. This works either on NT7 and NT8

      Example: Dataseries that keeps track of position on every bar while the strategy is running:

      position.Set(-1); // Flat
      if (atmStrategyId.Length > 0)
      {
      if (GetAtmStrategyMarketPosition(atmStrategyId) == Cbi.MarketPosition.Long)
      {
      position.Set(1); // Long
      }
      else
      {
      position.Set(0); // Short
      }
      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sergey_z, Today, 02:56 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by samir, Today, 02:46 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by neoikon, Today, 02:24 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by XimoTrader, Today, 12:57 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by FxInception, Today, 12:27 PM
      2 responses
      14 views
      0 likes
      Last Post FxInception  
      Working...
      X