Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Re-Entries with strategy that uses ATM exits

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

    Multiple Re-Entries with strategy that uses ATM exits

    Hi all
    I am developing a strategy that calls the ATM for SL Target Trail etc, the strategy uses a repainting filter and then candle entries for the trigger. The "entries per direction" is set to 1 (not unique entries either) and it will still take re-entries when the strategy validates multiple re-entries, usually causing a loss at the very bottom of a directional move.

    I would like to eliminate this but not sure if I need to code in a trade count per direction in addition to the one called from the State function?!
    Thank You
    FB

    #2
    Hello FBraun,

    The entries per direction setting is for managed or unmanaged strategies and not strategies that use ATM's. When using ATM's none of the normal strategy properties apply, you would have to program your own logic to control the strategy and how often it enters.

    Comment


      #3
      Hello again,
      One more question, can I go ahead and delete the following code below from [ OnStateChange; if (State == State.SetDefaults) ] since it doesn't apply to a strategy with ATM than?

      EntriesPerDirection = 1;
      EntryHandling = EntryHandling.AllEntries;​

      Also, is it possible to request a sample of the entries per direction & entry handling code? So that I can get an idea of how to go about adding it to my strategy please?
      Thank You
      FB

      Comment


        #4
        Hello FBraun,

        Yes, the strategy will still have default values for those properties if you don't set them. They just won't do anything because you are using ATM's.

        I am not aware of any entry handling code, you can view the SampleATMStrategy that comes with NinjaTrader as that makes sure there is only 1 entry at a time.

        Comment


          #5
          Similar question... I am using the SampleAtmStrategy but it takes another trade as soon as the first trade exists on the same bar till that bar completes and then it stops. I tried modifying the code to say

          if ((status[2] == "Filled" || status[2] == "Cancelled" || status[2] == "Rejected") && (BarsSinceExitExecution(0,"", 0) != 0))
          orderId = string.Empty;

          But that doesn't seem to help.

          any thoughts on how to change the code so that the SampleAtmStrategy only takes one entry per bar? I have a 6 tick profit target so a lot of times I end up automatically going from one trade to the next if the bar is more than 6 ticks above entry. Thanks!

          Comment


            #6
            Hello Holligoly,

            The strategy based methods like BarsSinceExitExecution do not apply to ATM strategies. You would need to form your logic identical to the SampleATMStategy script, that has the correct logic to handle doing a single entry at a time. In order to submit 1 entry per bar you would essentially have to duplicate the logic in the strategy to support more than 1 atm, that sample is intended to submit one atm and wait for it to be complete.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            38 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            64 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X