Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

restrict prints to once per trade

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

    restrict prints to once per trade

    How do i arrange my code to output prints only once per trade instead of onBarUpdate?

    #2
    Hello trader3000a,

    You would generally put the print inside your condition to trade to do that however if the condition to trade remains true then you would see multiple prints. This question really depends on your conditions to trade and how those operate. If your condition to trade remains true for multiple bars you may need to add a bool variable that is used to know when you printed so you can toggle the prints off until the next time you wanted the prints to begin working again.

    Code:
    if(myConditionToTrade)
    {
        Print(...);
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    46 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    66 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X