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

Coding Stop Limit orders as entries

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

    Coding Stop Limit orders as entries

    What I am trying to do is make a strategy to create a stop limit order similar to a "middle click of the DOM" ladder where its a pink square. Similar to the image below, I want to create a strategy that starts with creating a stop limit order as an entry. I guess EnterLongStopLimit() is not going to help me with this? I'm very confused, what function do I use to create a simple stop limit order like the image below?



    The EnterLongStopLimit() function requires two price parameters, one is the limit price, and one is the stop price. To my understanding this function would create a limit order and once filled, creates a stop order to sell. And this function always requires two price paramaters, however in my DOM image above, I only have one order and one price to that order. So I probably cannot use EnterLongStopLimit() for what I'm trying to get. So what functions can I use to create a long stop limit order? I looked at the ninja trader help guide but I can't find what I'm looking for... please help!
    Last edited by dennho; 01-15-2010, 04:25 AM.

    #2
    dennho, correct EnterLongStopLimit is not what you're after - you can just place a regular EnterLongLimit entry and then for example call SetStopLoss to place your Sell Stop order as protection.

    Or, you review our SampleAtmStrategy sample to learn how to call ATM strategy templates in NinjaScript strategies for exit management.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I should have been a bit more specific in my screenshot, I am currently FLAT, as in not holding any positions when you saw that stop limit order.

      So from a position of 0, how could I go about entering a position with a stop limit order? I looked through the strategy examples but I am not sure which one addresses my needs. I understand stop limit orders for exits, but not sure how to flip the logic around and make stop limit orders work for entries.
      Last edited by dennho; 01-15-2010, 01:01 PM.

      Comment


        #4
        Is it even possible to create an order entry as a stop limit order in NT? Keep in mind this is an position entry, not an exit. I can easily do this in DOM by middle clicking the mouse button and if the price moves up and passes my stop limit order it fills and I go long.

        Comment


          #5
          dennho, a long stop limit entry order in NinjaScript works like this: as soon as the price hits the stop price of the order, the "real" order is submitted at the limit price. The code for such an entry is as follows:
          Code:
          EnterLongStopLimit(limitPrice, stopPrice, "SMA Cross Entry");
          AustinNinjaTrader Customer Service

          Comment


            #6
            Oh, I did more searching and found EnterLongStop(), I shoulda had a sharper eye . I am testing it in market replay and it does indeed place the order visible in DOM. Thanks for the help!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kulwinder73, Today, 10:31 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by RookieTrader, Today, 09:37 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by terofs, Yesterday, 04:18 PM
            1 response
            24 views
            0 likes
            Last Post terofs
            by terofs
             
            Started by CommonWhale, Today, 09:55 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by Gerik, Today, 09:40 AM
            2 responses
            8 views
            0 likes
            Last Post Gerik
            by Gerik
             
            Working...
            X