Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

separate entry and exit strategy

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

    separate entry and exit strategy

    I have an entry strategy that I like, but I would like to use an ATM Strategy to exit those positions. Is that even possible to get those to work together? And if so, how does that need to be set up to get that to work?

    #2
    Hello Sir Show me the strategy please and i can help you add ATM to your strategy

    Comment


      #3
      It appears that the only way to utilize ATM Strategy is to include it into the programming of the strategy. So, it looks like using the SampleATM is best?
      I'm not going to lay out the entry method here in public, so the best proxy for what I am doing is a simple 5/13 EMA crossover entry method.

      if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0])
      {
      isAtmStrategyCreated = false; // reset atm strategy created check to false
      atmStrategyId = GetAtmStrategyUniqueId();
      orderId = GetAtmStrategyUniqueId();
      AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", 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;
      });
      }

      Comment


        #4
        Hello MojoFilter,

        The SampleATMStrategy would be the suggested way to approach submitting atms from NinjaScript. For a strategy to be able to attach the ATM to the entry it would also need to submit the entry that has the ATM attached to it. We generally suggest to make a copy of that script by doing a right click save as so you have all of the required variables and logic to use the ATM through its lifetime. The only changes you would need to make would be your entry condition and the template name you wanted to use.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Working...
        X