Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 GLFX005, Today, 03:23 AM
    0 responses
    1 view
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    12 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X