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 tornadoatc, Today, 01:23 PM
    0 responses
    5 views
    0 likes
    Last Post tornadoatc  
    Started by Akee5, Today, 12:46 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by XM010-3841, Today, 12:57 PM
    0 responses
    3 views
    0 likes
    Last Post XM010-3841  
    Started by sdauteuil, Today, 12:44 PM
    0 responses
    5 views
    0 likes
    Last Post sdauteuil  
    Started by franco12364, Today, 12:07 PM
    1 response
    4 views
    0 likes
    Last Post sdauteuil  
    Working...
    X