Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy conditions

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

    #16
    You could work with flags for this or change your strategy conditions for entry, most people have this issue because they don't work with CrossAbove / CrossBelow, but just with checking for if something is greater or smaller than a previous value. This of course will evalualate to true longer than 1 bar in most cases. Another way might be to record the barnumber the trade is placed on and then waiting for x bars to pass before another entry is permissioned.

    Comment


      #17
      Originally posted by NinjaTrader_Bertrand View Post
      You could work with flags for this or change your strategy conditions for entry, most people have this issue because they don't work with CrossAbove / CrossBelow, but just with checking for if something is greater or smaller than a previous value. This of course will evalualate to true longer than 1 bar in most cases. Another way might be to record the barnumber the trade is placed on and then waiting for x bars to pass before another entry is permissioned.

      Bertrand, great thinking. I have actually tried all of the above to no prevail except for barnumber. I tried a barnumber technique before but it did not work and someone said that it doesn't work with ATM methods (BarsSinceEntry() ).
      So how would you record the barnumber for example? Would it be in the ATM or in the Strategy?

      Thanks

      Comment


        #18
        You can do it directly in the strategy itself, when your conditions trigger for example a long entry (and you flag permits the entry) and the GetAtmStrategyMarketPosition reports you're long (http://www.ninjatrader-support.com/H...yPosition.html) you can save the current bar to a variable to get the entry barnumber. Then you can set / reset a flag with this info to toggle if further entries are allowed or not.

        Comment


          #19
          Ok let me know if this is right:

          privateint barNumberOfOrder = 0;

          // Condition set 1
          if (Open[0] > EOTVramBars(0.65, 1.3, true).VramUpConfirm[0]
          && orderId.Length == 0
          && atmStrategyId.Length ==
          0
          && CurrentBar > barNumberOfOrder + 10 )

          {
          atmStrategyId = GetAtmStrategyUniqueId();
          orderId = GetAtmStrategyUniqueId();
          AtmStrategyCreate(Action.Buy, OrderType.Market,
          0, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
          barNumberOfOrder = CurrentBar;
          }


          So that will only execute trade after 10th bar from previous trade?

          Comment


            #20
            jthom,

            At a glance that should do it.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Thanks Josh. Will test it out later. Thanks Bertrand for the point of direction.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              81 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              47 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              29 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              32 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              66 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X