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

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:	399
Size:	15.5 KB
ID:	1089427
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by MarianApalaghiei, Today, 10:49 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by XXtrader, Today, 11:30 PM
      0 responses
      3 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  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Working...
      X