Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AtmStrategyId 'xxx' does not exist?

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

    AtmStrategyId 'xxx' does not exist?

    I tried to use GetAtmStrategyMarketPosition(strategyId) but it always gives me an error message like:
    **NT** GetAtmStrategyMarketPosition() method error: AtmStrategyId '2556d53c464c4ddc8d7d126ff2573c04' does not exist
    What causes the problem?
    My code is very simple:

    string strategyId = GetAtmStrategyUniqueId();
    if(GetAtmStrategyMarketPosition(strategyId) == MarketPosition.Flat)
    {
    EnterLong();
    }
    Ironically, the code still runs, but the backtest result is different from using the following statement:
    Position.MarketPosition == MarketPosition.Flat
    Last edited by caiyusa; 03-22-2016, 02:17 PM.

    #2
    Hello caiyusa,

    During the time the order is alive but hasn't filled, this error is returned if the Atm Strategy is checked (because it doesn't exist yet). After the order fills, this error will no longer occur as long as the Atm Strategy is now active.

    Do you check that the entry is filled before checking the status of the Atm Strategy?

    Also, Position.MarketPosition == MarketPosition.Flat would not work. When using Atm Strategy commands the orders are not visible to the strategy. You would need to use GetAtmStrategyMarketPosition().
    http://ninjatrader.com/support/helpG...etposition.htm
    Last edited by NinjaTrader_ChelseaB; 03-22-2016, 02:41 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by popecapllc, 08-09-2023, 07:42 PM
    10 responses
    1,365 views
    0 likes
    Last Post BartMan
    by BartMan
     
    Started by jbays87, Today, 09:46 PM
    0 responses
    6 views
    0 likes
    Last Post jbays87
    by jbays87
     
    Started by ETFVoyageur, 04-30-2024, 02:04 PM
    11 responses
    101 views
    0 likes
    Last Post ETFVoyageur  
    Started by bubblegum, 03-18-2024, 10:41 AM
    3 responses
    48 views
    0 likes
    Last Post vjsworld  
    Started by JamesK1, Today, 02:48 PM
    1 response
    13 views
    0 likes
    Last Post JamesK1
    by JamesK1
     
    Working...
    X