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 gravdigaz6, Today, 11:40 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by MarianApalaghiei, Today, 10:49 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by XXtrader, Today, 11:30 PM
    0 responses
    4 views
    0 likes
    Last Post XXtrader  
    Started by love2code2trade, Yesterday, 01:45 PM
    4 responses
    28 views
    0 likes
    Last Post love2code2trade  
    Started by funk10101, Today, 09:43 PM
    0 responses
    9 views
    0 likes
    Last Post funk10101  
    Working...
    X