• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How Do I Limit a Strategy Trade Entry to Only ONE Trade?

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

    How Do I Limit a Strategy Trade Entry to Only ONE Trade?

    I have created a strategy that includes entries that are triggered when my Strategy criteria are met. However, once my profit target is met and that position is closed, if the entry qualifications are met with the next opening candle, another entry is triggered. How can I limit trade entries to only the FIRST one and not have subsequent trades entered. Thank you.

    #2
    Hello Lightheart,

    Thank you for your note.

    This would need to be controlled with logic.

    Are you wanting to reset this on each new session or only allow one entry ever unless the strategy is disabled and re-enabled?

    If you are wanting to only allow one entry unless the strategy is disabled/re-enabled you can compare BarsSinceEntryExecution() to be greater than -1.

    Below is a public link to the help guide on BarsSinceEntryExecution()
    https://ninjatrader.com/support/help...yexecution.htm

    You could also use a bool.
    Below is a public link to a 3rd party educational site on boolean.
    https://www.dotnetperls.com/bool
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ". . . Are you wanting to reset this on each new session or only allow one entry ever unless the strategy is disabled and re-enabled?"

      I would like to be able to disable and re-enable the strategy and let it trigger another entry if I feel conditions are right to do so.

      Thanks,

      Comment


        #4
        As I do not know how to code, and am only able to use the Strategy Builder, I am dead in the water with your answer. I don't know how to incorporate the BarsSinceEntryExecution command.

        Thanks.

        Comment


          #5
          Hello Lightheart,

          In the Strategy Builder the Condition and Actions page is where a condition would be added.

          In the Condition Builder this method can be found in Misc > 'Bars since entry'. This would be compared with Misc > Numerical value.

          Below is a link to the Strategy Builder 301 course.
          https://youtu.be/HCyt90GAs9k

          And a link to a forum post with helpful information about getting started with NinjaScript.
          http://ninjatrader.com/support/forum...609#post503609

          You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by akuntysh, Today, 09:21 PM
          0 responses
          1 view
          0 likes
          Last Post akuntysh  
          Started by goldfly, 08-27-2007, 07:05 PM
          12 responses
          11,506 views
          0 likes
          Last Post nkhoi
          by nkhoi
           
          Started by jrm999, Today, 07:44 PM
          0 responses
          2 views
          0 likes
          Last Post jrm999
          by jrm999
           
          Started by Iargo, Today, 05:53 PM
          0 responses
          5 views
          0 likes
          Last Post Iargo
          by Iargo
           
          Started by kadan, Today, 05:24 PM
          1 response
          5 views
          0 likes
          Last Post kadan
          by kadan
           
          Working...
          X