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 NullPointStrategies, Today, 05:17 AM
      0 responses
      20 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      119 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      63 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
      45 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X