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 FishTrade, 05-13-2024, 11:11 PM
    3 responses
    12 views
    0 likes
    Last Post FishTrade  
    Started by Graci117, Yesterday, 09:02 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by ETFVoyageur, Yesterday, 07:55 PM
    0 responses
    9 views
    0 likes
    Last Post ETFVoyageur  
    Started by janio973, Yesterday, 07:24 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by aligator, 01-06-2022, 12:14 PM
    4 responses
    252 views
    0 likes
    Last Post john_44573  
    Working...
    X