Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 Strategy Builder - Help with order submisson conditions

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

    NT8 Strategy Builder - Help with order submisson conditions

    Hi all! I am trying to create a simple strategy using a 1000 tick chart and a 50 SMA for instrument NQ

    the system goes long on a tick bar close above the 50 SMA and short on a tick bar close below the 50 SMA

    the problem I am having is after profit target is reached, for example on a long trade, it hits profit target then will immediately go long again as that bars close is still above the 50 SMA

    How and what condition can I add so that once a profit target is reached it doesn't enter a new trade until the short side is triggered. To clarify I want it to take profit on the long and then not enter a new trade till the short side conditions are met, and once that short side enters short and hits profit target I don't want it to trade again until the long conditions are met.

    Any and all help will be greatly appreciated! Thank you!

    #2
    Hello tonybeans,

    Welcome to the NinjaTrader forums!

    You can use a bool variable added on the Inputs and variables page.
    In the conditions for long entry require the bool to be false, submit a long entry and set to the bool to true. In the conditions for the short entry require the bool to be true submit the short entry and set the bool to false.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello tonybeans,

      Welcome to the NinjaTrader forums!

      You can use a bool variable added on the Inputs and variables page.
      In the conditions for long entry require the bool to be false, submit a long entry and set to the bool to true. In the conditions for the short entry require the bool to be true submit the short entry and set the bool to false.
      Okay I added the variables correctly I think, in conditions i have my false bool variable equal false, and then enter long convert to string "TrueBool" variable. and the opposite for the short side of the trade set

      but now my profit targets are not filling at the set ticks.

      Comment


        #4
        Originally posted by NinjaTrader_ChelseaB View Post
        Hello tonybeans,

        Welcome to the NinjaTrader forums!

        You can use a bool variable added on the Inputs and variables page.
        In the conditions for long entry require the bool to be false, submit a long entry and set to the bool to true. In the conditions for the short entry require the bool to be true submit the short entry and set the bool to false.
        does this look right for incorporating the bool variable to you?
        Click image for larger version

Name:	Screenshot 2023-02-17 180647.png
Views:	107
Size:	67.0 KB
ID:	1235815Click image for larger version

Name:	Screenshot 2023-02-17 180759.png
Views:	111
Size:	75.0 KB
ID:	1235817Click image for larger version

Name:	Screenshot 2023-02-17 180738.png
Views:	112
Size:	75.9 KB
ID:	1235816

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello tonybeans,

          Welcome to the NinjaTrader forums!

          You can use a bool variable added on the Inputs and variables page.
          In the conditions for long entry require the bool to be false, submit a long entry and set to the bool to true. In the conditions for the short entry require the bool to be true submit the short entry and set the bool to false.
          but now my profit target isn't being recognized. no its just enter long and closing the long when it enters short

          Click image for larger version

Name:	Screenshot 2023-02-17 180829.png
Views:	114
Size:	71.4 KB
ID:	1235819Click image for larger version

Name:	Screenshot 2023-02-17 180935.png
Views:	114
Size:	61.9 KB
ID:	1235820

          Comment


            #6
            Please help, I cant figure this out for the life of me anywhere

            Comment


              #7
              Hello tonybeans,

              This would be a single bool. When false a long order is submitted, when true a short order is submitted.

              private PlacedLongEntry = false;

              if (PlacedLongEntry == false && Close[0] > Open[0] && BarsSinceEntryExecution() > 0)
              {
              EnterLong();
              PlacedLongEntry = true;
              }

              if (PlaceLongEntry == true && Close[0] < Open[0] && BarsSinceEntryExecution() > 0)
              {
              EnterShort();
              PlacedLongEntry = false;
              }


              SetStopLoss() and SetProfitTarget() will both need a distance greater than 0 ticks or these will be ignored or rejected.

              Trying using 10 ticks.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              61 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              134 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X