Welcome to the NinjaTrader support forum.
In the builder, you would essentially just want to prevent further entries after the first as you can only set stop losses which always apply and cannot monitor them in the builder.
You can do this by using user variables, here is one example of toggling between long and short only allowing one entry per side.
- from the inputs and variables section, define a bool variable named CanEnterLong and set its default value to true.
- from the inputs and variables section, define a bool variable named CanEnterShort and set its default value to true.
- In the long entry condition, in addition to the existing conditions check that the CanEnterLong bool variable is true
- In the long entry action, in addition to entering set the value of the CanEnterLong to false.
- In the long entry action, in addition to entering set the value of the CanEnterShort to true.
This creates a one time entry for the long side but also enables the short side. The short side would be set up in the same way except it would check CanEnterShort is true in its condition and set CanEnterShort to false and CanEnterLong to true in its action. This will toggle between long and short trading and only allow one entry in that direction as it sets the bool to false once you enter.
I look forward to being of further assistance.
Leave a comment: