Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I clear the Max Consecutive Loser/Winner?

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

    How do I clear the Max Consecutive Loser/Winner?

    I'm using a sim101 account. I'm printing the max consecutive losers. Even though I've reset the sim acct several times, it still says that the max consecutive loser is '4' in the Output window.

    ALSO, when I run my method call "CheckForLoserCount();" It places a long trade at candle close. I have no logic that tells the strategy to place any trade. I want it to close the strategy.


    Code:
    Print(SystemPerformance.AllTrades.TradesPerformance.MaxConsecutiveLoser);
    
    
    private void CheckForLoserCount()
    {
            if (SystemPerformance.AllTrades.TradesPerformance.Max ConsecutiveLoser == LoserCount)
           {
                 CloseStrategy("StochMomentumStrat");
    
                /* if (PositionAccount.MarketPosition == MarketPosition.Long && PositionAccount.Quantity == ContractAmount)
                   {
                         ExitLong(ContractAmount);
                         CloseStrategy("StochMomentumStrat");
                   }
    
                  else if (PositionAccount.MarketPosition == MarketPosition.Short && PositionAccount.Quantity == ContractAmount)
                  {
                          ExitShort(ContractAmount);
                         CloseStrategy("StochMomentumStrat");
                   }*/
          }
    }

    #2
    Hello jamestrader21x,

    Thank you for your post.

    Could you provide a reduced example strategy that demonstrates this behavior?

    CloseStrategy would be expected to submit an order to close a position if the strategy thinks one is open. Are any manual trades being taken on the same instrument and account while the strategy is running, or are any other strategies running on the same account and instrument combination?

    Thanks in advance; I look forward to assisting you further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X