• 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

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, 01: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, 01:41 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by aprendiz, Today, 07:25 AM
    0 responses
    1 view
    0 likes
    Last Post aprendiz  
    Started by vivekniwas, Yesterday, 10:21 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by hir04068, Today, 06:58 AM
    0 responses
    5 views
    0 likes
    Last Post hir04068  
    Started by escobar63, Yesterday, 05:06 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by Brutus, Today, 06:00 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X