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

Atm Strategy order question

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

    Atm Strategy order question

    I created hot buttons to place orders for me on the chart Trader. I was wondering about the number of contracts. do I have to extract the order quantity from the chart trader or will the strategy fill the order quantity properly. If not do I make parameters in the Create Order Statement.

    here is what I have so far.

    TriggerCustomEvent(o =>
    {

    Order stopOrder = null;

    //################# HERE IS MY ORDER ################################
    stopOrder = myAccount.CreateOrder(Instrument, OrderAction.Sell, OrderType.StopMarket,
    TimeInForce.Day, 1, 0, dLowPrice, string.Empty, "Entry", null);

    // Submits our entry order with the ATM strategy using AtmStrategyName String

    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(AtmStrategyName, stopOrder);
    myAccount.Submit(new[] { stopOrder });

    }, null);
    e.Handled = true;

    THE QUESION IS :TimeInForce.Day, 1

    The number 1 is 1 contract, If I have a strategy set for 3 contracts do I change that to 3 or willthe create order know it is a strategy and fill properly. Click image for larger version

Name:	my quick buttons.PNG
Views:	267
Size:	9.6 KB
ID:	1121175

    #2
    Hello ballboy11,

    You are wanting to get the quantity from the ChartTrader QuantityUpDownSelector?

    Below is a link to a forum post on this.


    The AtmStrategyCreate() call will only use the quantity you supply to the method.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello ballboy11,

      You are wanting to get the quantity from the ChartTrader QuantityUpDownSelector?

      Below is a link to a forum post on this.
      https://ninjatrader.com/support/foru...194#post460194

      The AtmStrategyCreate() call will only use the quantity you supply to the method.
      Errr...m..., that's the issue AtmStrategyCreate doesn't have a quantity field in the argument. I would much prefer that the quantity is taken from the ChartTraderControlQuantityEdit but it doesn't. Is there a way to get the call to take that input instead of from the template?

      My argument for this is:
      1. The quantity to allocate for a setup depends on what I'm seeing as a discretionary trader so it's dynamic; it'd be too much of a hassle to edit and save the template each time I want to create an AtmStrategyCreate (in this case, I'm using mouse clicks as the input trigger)
      2. the idea of having AtmStrategyCreate is to create an order with the assumption that someone (a human trader) would be on hand to close out the trade anyway so why not allow us some flexibility to change the quantity on the call to the method?
      3. The AtmStrategyCreate can perhaps take in some optional inputs to override what is specified in the strategy without hurting anyone using the call as it is now - I don't see any problem with backward compatibility if it is incorporated this way

      Comment


        #4
        Hello mav8rick,

        Is there a way to get the call to take that input instead of from the template?
        No but you could look at using the addon based atm system with StartAtmStrategy. That takes an order object and with that you could specify a quantity for the entry order. The other quantities in the template would still remain static and there is no way to edit those from NinjaScript.



        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you for the tip - will look into it. Any chance of posting a future enhancement request on this? If we can have an order object as an argument to AtmStrategyCreate() would be ideal - removing the need to have an addon.

          Comment


            #6
            Hello mav8rick,

            I will add in a vote for adding an order object overload to the strategy based AtmStrategyCreate.

            Please let me know if I may be of additional assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,603 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            8 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            4 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            12 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X