Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The use of CurrentBar

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

    The use of CurrentBar

    Hello,

    How do you stop a loop with CurrentBar in OBU?

    Code:
    if(CurrentBar < 391) return;
    What if i want the loop to start at 391 and stop at 789? How do you write that?

    Code:
    if(CurrentBar < 391 & CurrentBar > 789 ) return;
    TY

    #2
    Hello frankduc,

    To stop a loop you would use break statement. https://docs.microsoft.com/en-us/dot...keywords/break

    If you wanted to use the CurrentBar you could use it like you have, I don't know how you are overall trying to use the CurrentBar to advise on that. CurrentBar is an int so you can use it in conditions like you have shown to check if its less equal or greater than a value.

    If you wanted to start at 391 and end at 789 in the loop you would need to use those values in your loop. To learn more about how to use loops please use Microsofts C# documentation: https://docs.microsoft.com/en-us/dot...h-the-for-loop

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    45 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X