Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trades being counted prior to strategy being enabled . . .

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

    Trades being counted prior to strategy being enabled . . .

    I have a Strategy that is set to only place trades during specific times and limits the number of trades per day. I have found that when I start the strategy after
    the scheduled start time that when the strategy is enabled that if the strategy would have placed orders prior to when it was started that it counts those trades
    as real trades.

    How do I get around this?

    #2
    Hello ATMtrader0001,

    Thanks for your post.

    If you are using your own trade counter variable, you could use a bool that you create and set to true by default and compare that bool along with comparing the State to State.Realtime and when both are true to then reset your trade counter and set the bool to false to prevent further resets. For example:

    if (State == State.Realtime && myBool)
    {
    myTradeCounter = 0; // reset for real time
    myBool = false; // prevent further resets
    }

    Comment


      #3
      Paul,

      As always, thank you. You are a wealth of knowledge.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 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
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X