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:	241
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 terkk, Today, 01:16 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Heath  
      Started by TraderElegante, Today, 12:14 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by dgee949, Today, 11:44 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_JustinD  
      Started by NinjaTrader_Kate, Today, 12:01 PM
      0 responses
      16 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by efeuvejota01, Today, 11:42 AM
      2 responses
      25 views
      0 likes
      Last Post efeuvejota01  
      Working...
      X