Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to include ATM strategy into my custom strategy

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

    How to include ATM strategy into my custom strategy

    Hello everyone,
    I implemented a strategy within ninjatrader but I noticed that sometimes stops and targets are put incorrectly, so I thought I would implement the function of being able to use the ATM strategy in such a way that you can also use all its features, like trailin stop and stop a breakeven. First of all I would like to clarify: is it true that ATM strategy is not testable using backtest or playback? I read this in the documentation. I also do not know where to start because I did not understand how it works, for example, the simple strategy ATM present in the editor. I have a code that has a number of conditions, but in the end the part of the code where I open a position is always the same:
    SetStopLoss(...);
    SetProfitTarget(...);
    EnterLong(); (Or EnterShort()

    Instead of this part of code how can I call up the ATM strategy features? Also someone could explain me why using these methods (which 90% of the time work correctly) sometimes do not set stop and target correctly?

    Thank you so much for your time​​

    #2
    You Might find a solution to your question @ you tube search for j2 algo he has a video series compliation, that may help you.

    Comment


      #3
      Hello angelvincent37,

      Thank you for your post.

      There are two parts to your inquiry. First, you have used SetStopLoss() and SetProfitTarget() yet experienced some behavior that resulted in the stop and target not being set as expected. Second, as a way around this, you have tried out using an ATM strategy in a NinjaScript strategy and have some questions about how that works.

      I will need additional information in order to address what might be happening with the stops and targets. You mentioned that the Set() methods work correctly 90% of the time; what is happening when they are not working as expected? Do you receive any errors on the screen or in the Log tab of the Control Center? What is the expected behavior vs. the actual behavior you are seeing?

      As for using ATM strategies within a NinjaScript strategy, you are correct that these strategies may not be backtested via the Strategy Builder. They may, however, be tested in the Playback connection because this allows the strategy to be in State.RealTime while the data is being played back. The SampleAtmStrategy script that comes with NinjaTrader by default requires you to have an ATM strategy template saved with the name 'AtmStrategyTemplate' and once you have that, you may test it out in Playback to see that it works. If you want the ATM strategy to have a trailing stop and/or breakeven function, you need to save that information inside of the template.
      Here are the resources related to using ATM strategies inside of a NinjaScript strategy; please let me know if you have a specific question about how these methods work or if you are getting an error in the platform:I look forward to your reply.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X