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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    58 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    195 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    359 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    281 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X