Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy start behaviour

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

    Strategy start behaviour

    Hello,

    I have developed a strategy which I am using as a semi-automated trade execution system, almost like an advanced ATM Strategy.

    I only enable my strategy when I have identified that the correct market conditions exist i.e. I may only enable my strategy for part of the trading session, not leave it running autonomously throughout the full trading session.

    Within this strategy there are two conditions which will provide a signal bar, the strategy then structures the trade in accordance with my risk management plan embedded in my strategy.

    The issue I have is that say I enable my strategy at 11:30am, if the signal bar has occurred at say 11am prior to me enabling the strategy then the strategy would assume that I am already in a trade and my position is not flat. If a second signal bar occurs shortly after I have enabled the strategy at say 11:45am then the strategy will not place the trade as it will take the historical trade position and not the live condition.

    Is there a way to override the historical condition with the strategy assuming the next signal bar is a valid signal irrespective of if the historical position is flat or not?

    Thanks,

    Neil

    #2
    Hello burtoninlondon,

    You could add a condition to return for historical bars so no trades are placed historically. That would be:

    if(State == State.Historical) return;

    If you have other logic that needs to still calculate historically you could also add this type of condition to your entry condition, checking if the state is realtime.

    Comment


      #3
      Thanks NinjaTrader_Jesse that seems to work for me.

      Neil

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X