Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ASM Strategy

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

    ASM Strategy

    I am implementing an ASM strategy as follows:

    if (AsmStrategyMarketPosition == MarketPosition.Flat && !AsmStrategyActive)
    {
    if (BuySignal == true)
    {
    AsmStrategyCreate(Action.Buy, OrderType.Market, 0, 0, TimeInForce.Day, "Test");
    }
    else if (SellSignal == true)
    {
    AsmStrategyCreate(Action.Sell, OrderType.Market, 0, 0, TimeInForce.Day, "Test");
    }
    }


    I set this strategy up to run against Sim101, but found that, if I manually trade against another account, the strategy does not run. I assume this is because manually trading with an ASM makes AsmStrategyActive = True and AsmStrategyMarketPosition not flat, even though I'm using a different ASM for manual and the strategy. Is this correct? Is there any way to determine which ASM strategy (i.e. "Test" versus "Production") is active from within the script?
    Also, do AsmStrategyActive etc. functions span all instruments or do they only look for active strategies in the current instrument?

    #2
    imported post

    We are going to release another beta update likely Monday that has revamped all of the ASM strategy methods so do not spend muchmore time debugging the current source code.

    If trading both manually and have a NinjaScript strategy execute an ASM Strategy in the same market, you have to be sensitive to what buttons you press manually.

    Pressing Flatten Everything, ClosePosition via Positions Tab or pressing the CLOSE button in the SuperDOM with your left mouse button will close the position, cancell all working orders and terminate any active strategies. This is likely what is happening. Instead, when closinga strategy in the SuperDOM, use your middle mouse button which internally closes the strategy and position associated to it, NOT the actual account position. This will leave your NinjaScript strategy running. More information on this with the new methods in the next udpate in the Help Guide.

    Ray
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, Yesterday, 01:02 PM
    0 responses
    30 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    22 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X