Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limiting consecutive same direction trades

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

    #16
    The issue here was this.Name was changing the name as it appears in the Indicators list from charts.

    Removing this and changing the classname of the script corrected the issue.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Strategy Wizard?

      Is there a way in the wizard to code saying that I want to only take longs above a certain price and only take shorts below that same price? I've tried a couple of conditions without success.Thanks in advance

      Comment


        #18
        Hello futures614,

        Thank you for your post.

        There would only be the option to check for the current price against a certain level and then submit the order. Please see the attached screenshot for an example.
        Attached Files

        Comment


          #19
          Strategy Analyzer

          I've looked in ninjatrader help and I guess I'm having a senior moment. Could you direct me on to get to the strategy analyzer? Also, is their a way to code in the wizard when a buy condition is met to say buy at the next bar open less 2 ticks? Thanks

          Comment


            #20
            Hi futures614,

            File -> New -> Strategy Analyzer


            Attached is a screenshot of an action set to enter 2 ticks below the close.
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              Coding a color in strategy wizard

              Is there a way to code in the wizard a condition saying to go long when the indicator plots green and short when it plots red? Thank you

              Comment


                #22
                Profit Target Not Working

                I'm using the strat wizard because of my lack of coding expertise. Attached are a few screenshots of what I'm trying to accomplish. For example, I have a limit order to enter long and I'm trying to exit at 10 ticks profit, but on the trade I'm sending screen shot of, the entry long was 1140.8, the price did exceed 1141.8, but it did not fill. I have no clue why. Your help is appreciated. Thanks
                Attached Files

                Comment


                  #23
                  Hi futures614,

                  The SetProfitTarget on the last page of the wizard is set to EnterLongLimit and EnterShortLimit fromSignalNames.

                  However, in your screenshot showing Condition Set 1, there is no signal name used on the EnterLongLimit.

                  This means the SetProfitTarget is attached to nothing and will not close your order.

                  If you do not use a signalName in the entry order, do not use a fromSignalName in the exit.

                  Signal names are used to match an exit order to an entry order.

                  Below are links to the help guide. In the Managed Approach read 'Entry Methods'. In SetProfitTarget, read the bit about fromSignalNames.

                  http://www.ninjatrader.com/support/h...d_approach.htm

                  http://www.ninjatrader.com/support/h...ofittarget.htm
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #24
                    Limit to one trade per direction

                    Good morning,

                    I'm working on a strat thru the wizard and would like to tell the strat only take the first long when the signal is given and vice versa for when a short is signaled. In other words, I don't want it to take more than the initial trade in any given direction. I would appreciate your help. Thank you in advance.

                    Gary

                    Comment


                      #25
                      Hello Gary,

                      The number of trades in a direction is controlled by the Entries per direction option in the Strategy Parameters when running / backtesting the script.

                      If this is set to 1 and the EntryHandling is set to AllEntries, only 1 long entry will be allowed, or 1 short entry will be allowed. All other orders will be ignored.

                      http://www.ninjatrader.com/support/h...t_strategy.htm

                      You can also check your position to see if you are long or short and use that to prevent an order.

                      For example on the entry conditions have a condition added with:
                      'Strategy -> Current market position' selected on the left
                      '!=' as the operator in the center
                      'Strategy -> Long' seleted on the right
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #26
                        Thanks for your response.
                        I'm not sure I asked my question correctly. What I would like the strat to do is only show results of taking the initial long signal and then not take any more longs once the profit target or stop has been reached. Then the next signal the strat would take would be a short. I want to rotate between taking a long, reaching target or stop loss and then the strat goes short based on the trading parameters. What I have now takes one long after another, for example, if in an extended uptrend. Maybe what I'm asking is not possible? Thanks for your indulgence.

                        Comment


                          #27
                          Hi futures614,

                          For ensuring the next order is in the opposite direction of the previous order, you will want to use a bool or some variable that holds the state.

                          After the order goes in, change the value of the bool. Use the bool in the condition to ensure the state of the bool before placing an order.

                          For example:
                          In #region Variables:
                          private bool takeLong = true;

                          In OnBarUpdate():
                          if (takeLong == true)
                          {
                          EnterLong();
                          takeLong = false;
                          }
                          else
                          {
                          EnterShort();
                          takeLong = true;
                          }
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by ScottW, Today, 06:09 PM
                          0 responses
                          2 views
                          0 likes
                          Last Post ScottW
                          by ScottW
                           
                          Started by Board game geek, 10-29-2023, 12:00 PM
                          14 responses
                          244 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by Waxavi, 04-19-2024, 02:10 AM
                          4 responses
                          56 views
                          0 likes
                          Last Post sonia0101  
                          Started by cmtjoancolmenero, Today, 03:58 PM
                          0 responses
                          9 views
                          0 likes
                          Last Post cmtjoancolmenero  
                          Started by Segwin, 05-07-2018, 02:15 PM
                          11 responses
                          1,779 views
                          0 likes
                          Last Post aligator  
                          Working...
                          X