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

How to set limit price and stop price for AtmStrategyCreate() and StopLimit orderType

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

    How to set limit price and stop price for AtmStrategyCreate() and StopLimit orderType

    I am not too sure how to set the limit price and stop price when using AtmStrategyCreate() and an orderType of StopLimit. Let's say the current price is at 3238.00 and I want to use AtmStrategyCreate() to sell at 3237.00 or better when the price touches 3237.00. How would I go about setting the limit price and stop price in such a case? Any help would be much appreciated.
    Last edited by mbesha; 01-07-2020, 10:37 AM.

    #2
    Hello mbesha,

    If you are wanting to specifically set the price of your targets through code or customize them you should instead use one of the other strategy approaches like managed or unmanaged.

    An ATM specifically has no options to control the targets because that is the purpose of your ATM strategy and what is defined in its template. To have the targets submitted you would just need to have the entry order fill. Once that happens whatever you had defined in the ATM template for the targets would be used. Those targets are not going to be managed by the NinjaScript strategy and will be unable to be modified through code.





    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse

      I am not looking to control the target but the entry price. I understand that the stop loss, profit target and stop strategy are set in the template of the ATM strategy but my problem is that I am trying to use a managed approach by utilizing the AtmStrategyCreate() method and I am unsure how to set the limitPrice and stopPrice parameters especially for the StopLimit orderType. Please enlighten me on how to use these using the example I gave.

      Comment


        #4
        Hello mbesha,

        but my problem is that I am trying to use a managed approach by utilizing the AtmStrategyCreate()
        To further clarify the ATM system is not part of the Managed or Unmanaged approach and these cannot be combined, I just wanted to make sure that is clear that there are 3 different entry systems which are the ATM, managed and unamanged. You can only use one entry approach at a time such as ATM's with ATMStrategyCreate.

        What is your specific question surrounding using the stop or limit prices? These would work the same as other Limit/stop type orders where you would enter a price in which you wanted the order to be at.
        Are you asking how to calculate an offset from the close price? What specifically did you need help with in regard to the prices?

        If you are not sure on how to use the values or the order they should go in I would suggest looking at a ChartTrader and then Right Click in the chart above or below the price. This will produce the types of orders which can be placed on that side of the market. This is helpful if you are not certain what order the prices should go in you can experiment by placing those type of orders and then looking in the Control center at what the stop and limit prices were.







        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I've the same question as mbesha. I understand what his/her question is, which I think Jesse misses the question.
          Using the eg from mbesha, if price is falling from above 3237, & use NT script AtmStrategyCreate(OrderAction.Sell, OrderType.StopLimit, limitPrice, 3237,...), one can't use a limitPrice (say, 3236) that is greater than the stopPrice (3237 here), otherwise will get a runtime error msg saying "Limit can't be greater than stop price".


          Is there a way to get around this with AtmStrategyCreate?
          Note that with manual trading using Chart Trader, one can achieve this effect by setting the "Predefined stop limit offset value" to a negative value.

          Thanks for your help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by hazylizard, Today, 08:38 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by geddyisodin, Today, 05:20 AM
          2 responses
          17 views
          0 likes
          Last Post geddyisodin  
          Started by Max238, Today, 01:28 AM
          5 responses
          45 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by giulyko00, Yesterday, 12:03 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by habeebft, Today, 07:27 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChristopherS  
          Working...
          X