Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy to place order when price comes close to a line

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

    Strategy to place order when price comes close to a line

    Is there strategy code I can incorporate which places an order using an ATM strategy when price gets to within x ticks of a line? Enter long if it approaches line from high to low, enter short if approaches line from low to high.

    I could try using alerts and action to place order, however that doesn't allow placing order using ATM strategy.

    #2
    Hello higher.high,

    Thanks for your post.

    You can create a Ninjascript strategy that can accomplish your goal. The strategy can be coded to provide the logic of line detection, comparing price to the line, placing an entry order and assigning an existing ATM strategy template to cover the profit/stops.

    You would not be able to accomplish this in the strategy builder.

    In your Ninjatrader is the strategy SampleATMstrategy which can demonstrate the use of a strategy that places an entry order and calls a specific ATM template. This could be the model for the strategy as it uses special methods to work with ATMs which. The strategy is well commented in the code to help explain what the methods and properties are doing/for. Here is a link to the special methods that the strategy uses: https://ninjatrader.com/support/help...gy_methods.htm

    If the strategy is drawing the line that is of interest then it is straight forward for the strategy as it then knows the price level of the line. If this is a manually drawn line, then you would need additional coding to detect that line and pull the price value of the line into the strategy. Here is a link to the help guide that shows how to cycle through the draw objects collection to find a specific object: https://ninjatrader.com/support/help...rawobjects.htm

    If you would like a strategy created for you, to accomplish your goals, we can provide a link to 3rd party programmers that would provide that service.


    Regarding, "I could try using alerts and action to place order,however that doesn't allow placing order using ATM strategy." That is not true, the chart alert/ATM feature was implemented in 8.0.18.1, you can use a chart Alert to place an order and select the ATM template to use when that entry order fills.

    Click image for larger version

Name:	HH-3.PNG
Views:	450
Size:	15.5 KB
ID:	1089427

    Comment


      #3
      Thanks Paul.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      59 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X