• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to understand StopLimit Buy Order

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

    Trying to understand StopLimit Buy Order

    Hello

    I am trying to understand how StopLimit Buy Orders work.
    I use the Simulated Data Feed with Instrument = FDAX 06-18

    When I place a StopLimit Buy Order with :
    - Stop price = 12560
    - Limit price = 12570

    Then the order is well opened when the price is below 12560 and reaches 12560.
    Then when the price keeps on going up, the order is not closed when the price reaches 12570.

    Could you explain how to force the order to be closed with the Limit price ?

    Thanks !

    #2
    Hello investdatasystems,

    A stop limit order when the stop is touched at the stop price becomes a limit at the specified limit price.

    A limit order fills at the specified price or better.

    If the market is ahead of a limit order it will not fill. Only one the price drops to the to limit or behind it will the order fill.

    Below are public links to investopedia on Stop Limit and Limit orders.
    https://www.investopedia.com/terms/s...limitorder.asp
    https://www.investopedia.com/terms/l/limitorder.asp


    If you are wanting an order that fills when touched, use a Stop Market order. When the stop is touched, this order type becomes a Market Order.

    Below is a public link to investopedia on Stop Market orders.
    https://www.investopedia.com/terms/s/stoporder.asp
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello !

      Thank you for your reply.

      I will find more info in french. I have found a link in french that is very good : https://www.activtrades.com/fr/types-d-ordres

      What I want to do is :
      - When the price reaches a specified level
      - Then open a Buy order with a specified TP and SL

      So I think I should do the following :
      - Use a Buy Stop Order with level to reach for the position to be opened
      - Use SetTargetProfit and SetStopLoss on the Buy Stop Order (Is that possible ?)

      Thanks

      Update :
      It is ok now, here is how I proceed :

      Code:
      		double ask = 0;
      		double bid = 0;
      		bool done = false;
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
      			ask = this.GetCurrentAsk();
                  bid = this.GetCurrentBid();
      			
      			if (this.Historical == true) return;
      			
      			if (done == false){
      				IOrder order = this.EnterLongStop(1, ask+5, "MonSignalName");
      				this.SetProfitTarget("MonSignalName", CalculationMode.Price, bid+10);
      				this.SetStopLoss("MonSignalName", CalculationMode.Price, ask-20, false);
      				Print("stop price = " + (ask+5));
      				Print("tp price = " + (bid+10));
      				Print("sl price = " + (ask-20));
      				done = true;
      			}
              }
      Last edited by investdatasystems; 04-24-2018, 01:18 AM.

      Comment


        #4
        Hello investdatasystems,

        I see you are creating a NinjaScript Strategy instead of placing manual orders.

        Yes you can use SetStopLoss() and this will use a stop limit order with the limit hard coded to be 20 ticks a head of the stop price. This means when the stop is touched the limit should be ahead of the market and should fill immediately.

        I recommend that you call SetStopLoss() and SetProfitTarget() before placing the entry order. (As these cannot be unset and will continue to use an old price when an new entry is made unless the signalName / fromEntrySignal is unique for each new entry)

        Below I am providing a link to a NinjaTrader 7 example strategy called CustomStopStrategyWithTrailExample that demonstrates using SetStopLoss().
        https://ninjatrader.com/support/foru...139#post422139
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DTSSTS, Today, 02:46 PM
        0 responses
        2 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Started by corman, Today, 02:45 PM
        0 responses
        1 view
        0 likes
        Last Post corman
        by corman
         
        Started by sandman, Today, 02:32 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by ksarin, Today, 12:39 PM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by ttodua, Today, 12:03 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X