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

Limit and stop entries

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

    Limit and stop entries

    I looked in past threads and cant find an answer to this question .

    Simply , will a limit or stop order entry be cancelled if its not filled on the next bar after the signal triggers ? I've ben forward testing my strategy against live data entering with a market order and am looking for better fills .This is with a ninjascript strategy .

    If so , can I set it up so the ( limit or stop entry ) order will stay active a set number of bars , until it fills or another signal occurs ? Can I do it with the wizard ?

    #2
    Yes, they will cancel. If you do not keep it alive by resubmitting on the next bar they will cancel. If you want to keep it alive for x bars, keep resubmitting.

    Please read the "Order Submission for Entry and Exit Methods - Basic Operation" section of this article: http://www.ninjatrader-support.com/H...verview36.html
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks , also if I run a strategy against live data that enters with a stop order to enter , will the chart NOT show the signals from before the point I load the strategy on the chart ?

      I ask that because when I load a strategy against live data that enters with a market order , the signals and trades that occured before I loaded the strategy show up on the chart with the entries being the closing price ( minus the slippage I factored in ) of the bar that the signal occurs .

      Comment


        #4
        Not sure what you mean. When you load a strategy onto a chart it will show all prior simulated trades.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Maybe I dont have it set up right . What I'm trying to do is - IF fast MA crosses below slow MA THEN enter short position with a stop order - stop price is the fast MA .

          I want it to enter with astop order if price hits the fast MA after the crossover condition is met .

          Comment


            #6
            Right. So you need to keep your orders alive by resubmitting. For sure your orders will cancel because the cross condition is only true for one bar. You should have it set a flag variable to true when the cross happens instead.

            Untested code
            Code:
            if (CrossBelow(SMA(Fast), SMA(Slow), 0))
            {
                 flagVariable = true;
            }
            
            if (flagVariable == true)
            {
                 EnterShortStop(SMA(Fast)[0]);
            }
            
            if (Position.MarketPosition == MarketPosition.Short)
            {
                 flagVariable = false;
            }
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thanks for that Josh . One more question , I want to enter 2 units and have two seperate profit targets and stops , can I accomplish this using the wizard and how ?

              Comment


                #8
                You will need to call EnterLong twice. Use two separate entry signal names and then match them accordingly with two sets of stops/targets in the Strategy Wizard.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I'm trying to enter two units at the same time ( same signal ) . I Call enter long two seperate times in the same actions box , name one "1" and the other "2" but only "1" enters .

                  Comment


                    #10
                    When you run your strategy you need to increase your EntriesPerDirection allowance.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      That was easy thanks !

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by owen5819, Today, 02:24 PM
                      0 responses
                      5 views
                      0 likes
                      Last Post owen5819  
                      Started by OllieFeraher, 05-09-2024, 11:14 AM
                      4 responses
                      14 views
                      0 likes
                      Last Post MisterTee  
                      Started by dcriador, Today, 12:06 PM
                      0 responses
                      10 views
                      0 likes
                      Last Post dcriador  
                      Started by dcriador, Today, 12:04 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post dcriador  
                      Started by cutzpr, Today, 08:54 AM
                      0 responses
                      11 views
                      0 likes
                      Last Post cutzpr
                      by cutzpr
                       
                      Working...
                      X