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

Adding size to an existing ATM Strategy

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

    Adding size to an existing ATM Strategy

    Hi There,

    I have a strategy that enters the market with an atm strategy (just 1 target, 1 stop) as follows:
    Code:
    AtmStrategyCreate(OrderAction.Buy, EntryPrice >= GetCurrentAsk() ? OrderType.StopMarket : OrderType.Limit, EntryPrice, EntryPrice, TimeInForce.Day, orderId, "ToffyLadder", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
    //check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
    if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId){
    isAtmStrategyCreated = true;
    stratRunAttempts++;
    }
    });
    I subsequently adjust the target price and the stop price.
    Now I would like to add to this position so that the target and stop orders pick up the additional quantities for the exit. (Which works just like that when manually entering trades as long as the same ATM strategy is selected.)

    I ensure programmatically the same ATM Strategy is selected in Chart Trader and then simply enter via
    Code:
    EnterLongStopMarket(0, true, qty, stopPrice, "Entry_" + n);
    The orders are executed fine, but not added to the ATM strategy.

    Two questions:
    1) How do I need to create the entries to be added? Each as a separate AtmStrategyCreate?
    2) Once the ATM Strategy is active, how can I obtain the current price level or TARGET1 and STOP1?

    Thanks in advance!

    #2
    Hello Adfra,

    With AtmStrategy methods there would not be a way to scale in to an existing Atm. A new one would have to be created with AtmStrategyCreate().

    Through the Addon approach the order quantities could be modified.

    Below is a link to a forum post that discusses.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Irukandji, Today, 09:34 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by RubenCazorla, Today, 09:07 AM
    1 response
    5 views
    0 likes
    Last Post RubenCazorla  
    Started by TraderBCL, Today, 04:38 AM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by WeyldFalcon, 08-07-2020, 06:13 AM
    11 responses
    1,423 views
    0 likes
    Last Post jculp
    by jculp
     
    Started by BarzTrading, Today, 07:25 AM
    2 responses
    29 views
    1 like
    Last Post BarzTrading  
    Working...
    X