• 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 jerblaster23, Today, 03:42 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by brian meade, Today, 01:39 PM
    2 responses
    10 views
    0 likes
    Last Post brian meade  
    Started by Johnny Santiago, Today, 12:20 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by NinjaTrader_Brandon, Today, 10:24 AM
    0 responses
    64 views
    0 likes
    Last Post NinjaTrader_Brandon  
    Started by ptertich, Today, 07:56 AM
    2 responses
    19 views
    0 likes
    Last Post Johnny Santiago  
    Working...
    X