Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit Target and Stop loss change the number of trades

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

    Profit Target and Stop loss change the number of trades


    Hi I have a strategy that I am testing that is always in the market. Now I have added some stop loss and profit targets conditions and I have realized that the number of trades changes based on them. How can this be possible?

    Assume that if it’s flat the enter condition is the same that if it is on market and it is changing the direction.

    Thanks
    Last edited by ssierra; 06-10-2008, 04:08 PM.

    #2
    Your strategy does what you tell it to do...You will have to debug to understand how the changes you have made impact your strategy.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ok but I don’t see any problem. As example I took your SampleMACrossOver strategy and added a stop and a target. As it is it works fine, whatever the stop and targets are the number of trades is the same. But if I want to have a crossover with a the MA delayed is where I get problems.
      The code is as follows:

      {
      if (CrossAbove(SMA(Fast), SMA(Fast)[2], 1))
      EnterLong();
      elseif (CrossBelow(SMA(Fast), SMA(Fast)[2], 1))
      EnterShort();
      }


      And the original is:

      {
      if (CrossAbove(SMA(Fast), SMA(Slow), 1))
      EnterLong();
      elseif (CrossBelow(SMA(Fast), SMA(Slow), 1))
      EnterShort();
      }

      What is wrong for changing the number of trades?

      Edited with message 4.
      Last edited by ssierra; 06-11-2008, 01:38 AM.

      Comment


        #4
        The code you modified it to will definitely produce different results. The original code makes little sense in logical terms because you are asking for when the SMA(Fast) crosses over itself. In your modified code you are asking when the SMA(Fast) crosses the SMA(Fast) of 2 bars ago. This makes more sense and it will behave accordingly.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Johs,

          sorry the original code is this one:

          {
          if
          (CrossAbove(SMA(Fast), SMA(Slow), 1))
          EnterLong();
          elseif (CrossBelow(SMA(Fast), SMA(Slow), 1))
          EnterShort();

          That is as it is in the example and gives the same number of trades whatever the stop is. What is giving me problemes is the one that crossover a delayed media and based on your comment it is fine.

          Thanks,

          Comment


            #6
            How are you determining what you are seeing is abnormal? You cannot compare the two situations since they are not equivalent. They will definitely produce different trades.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by Josh View Post
              How are you determining what you are seeing is abnormal? You cannot compare the two situations since they are not equivalent. They will definitely produce different trades.
              No I am not saying that. Sorry if I dint explained myself properly.

              Using the original code if I optimize the stops and targets whatever the parameters are the numbers of trades are always the same, as expected.

              The problem is that with the new code optimizing the stops and targets gives different number of trades that doesn’t make sense.

              I am not comparing the number of trades with the original code I am comparing the number of trades of the same strategy using different stops and targets.

              Many thanks for the help

              Comment


                #8
                In any case...This is a question of reviewing your strategy and each trade generated to see if in fact, what happens is as you have coded it. We can not tell you why to get different results but I can say that what is happening is based on your strategy logic. If it were me, I would go step by step, fill by fill to understand what is happening.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  Stop Position

                  I wonder if something's wrong wiht this commands or if have another commands that I can close all open orders ...



                  if (CrossBelow(Momentum(momentumPeriod), 0, 1))
                  ExitShortStop(Position.MarketPosition,
                  "", "");


                  the goal is when the period line crossesover the 0 line close all orders...

                  Thank you.

                  Comment


                    #10
                    Welcome to our forums here marcos_vitorino, your command would issue a Stop Market order, if you just want to exit the quickest way possible on your condition just call ExitShort() for a straight market order.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    633 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    567 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X