Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Limit order

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

    Stop Limit order

    Hi I am a newbie at programing with Ninjatrader. I am just wondering how to program a Stop Limit order? I have the following Stop order functioning but I need to change to a Stop Limit with one tick:

    double mom = Momentum(Close, FastLen)[0];
    double mom1 = Momentum(Close, FastLen)[1];
    if (mom < 0 || mom<=mom1);
    {
    EnterLongStop(RoundPrice(Close[
    0] + (High[0] - Low[0])));
    }


    Thank you very much for any help

    #2
    EnterLongStopLimit(int quantity, double limitPrice, double stopPrice, string signalName);

    Mike

    Comment


      #3
      Thanks for the help Mike. Just one last question. If I am trading a one lot on the euro currecy on the globex and i want a one tick stop limit so that if the stop price is 1.3601 the Limit price is 1.3602, how would I set the EnterLongStopLimit?
      Thanks again

      Comment


        #4
        Originally posted by ectrader View Post
        Thanks for the help Mike. Just one last question. If I am trading a one lot on the euro currecy on the globex and i want a one tick stop limit so that if the stop price is 1.3601 the Limit price is 1.3602, how would I set the EnterLongStopLimit?
        Thanks again
        First, be forewarned that Limit orders with backtests can produce unreliable results. Works fine in live trading, but with backtests there can be lots of issues depending on what you are doing.

        If I understand you correctly, you want to go long once the price moves higher to 1.3602, placing a limit order at 1.3601 (1 tick improvement) once it triggers.

        EnterLongStopLimit(DefaultQuantity, 1.3601, 1.3602, "my buy stop long limit");

        If you have the price in a variable, you can specify a one tick improvement by using the TickSize method. ie: Close[0] - TickSize.

        Mike

        Comment


          #5
          thanks Mike!!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by KavinBase, Today, 02:43 AM
          0 responses
          1 view
          0 likes
          Last Post KavinBase  
          Started by szferi, Today, 02:04 AM
          0 responses
          4 views
          0 likes
          Last Post szferi
          by szferi
           
          Started by MidenThur, Today, 12:52 AM
          0 responses
          6 views
          0 likes
          Last Post MidenThur  
          Started by seseoraf, Today, 12:51 AM
          1 response
          6 views
          0 likes
          Last Post charmingishagarg  
          Started by Rosario, Today, 12:50 AM
          0 responses
          4 views
          0 likes
          Last Post Rosario
          by Rosario
           
          Working...
          X