Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set position to occur only once

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

    Set position to occur only once

    I just purchased the NT7 license and now trying to write a strategy, so I'm really a newbie here and would like some help.

    I am trying to incorporate the MACD > average into my system with a very small profit taking.

    For example, if trigger happens and I take a position and get a profit, I would like to stop the strategy until another trigger happens. Currently, even if I take a profit, the strategy would still take up another position, until my stop loss.

    I understand its because of the strategy, MACD > average. How do I arrange it so that it would only occur once per direction or until another trigger occurs instead of multiple positions per trigger.

    #2
    Have you unlocked the code and are editing the strategy?

    Searching on "once per direction" returns some previously discussed tips that should prove useful:

    Comment


      #3
      plusactive, thanks for the post and for aquiring a license. I would express the entry via a CrossOver rule and not just checking if the MACD value is greater than your average, since that could be true for a consecutive number of bars, which means if you're out with the profit the entry conditions would allow for another entry of the same signal, which would then happen. With the CrossAbove rule you would only have an entry on the cross point for the two values, so if you're exits have triggered it will wait for another occurrence.

      Handling a CrossOver condition would be shown in the 7th section on this link in our online documentation - https://www.ninjatrader.com/support/...on_builder.htm

      All the best,

      Comment


        #4
        Thanks Bertrand. I've tried the crossover and it did only take one entry. However, I have included another condition to exceed a certain % before the buy is triggered. This is where the whole problem started, as it meets both the conditions, hence the multiple entries.

        Thanks Sledge. I'm looking through your link and it seems to match my requirements. Will try out some suggestions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X