Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SessionBreak- how to work with

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

    SessionBreak- how to work with

    Hello,

    I have added in my autoscripts "if(Bars.SessionBreak == true) {then reset variables}

    But to my surprise the variables persists in the reset status then. Even when a condition is true to change value of a variable is persists with "0" and "false"

    What am I doing wrong or how has to be used SessionBreak correctly?

    Thank you
    Tony

    #2
    Hello,

    Thank you for the question.

    I could not really say what may be happening with what has been posted.

    Are you certain the reset is happening before the variables need to be used again?

    For this, I could only suggest to create a new empty script and migrate only the if(Bars.SessionBreak == true) logic into that new script to see what may be happening. If you could isolate a sample like this and provide it, I could certainly be of more help.

    I look forward to being of further assistance.

    Comment


      #3
      Hello Jesse,

      thank you for your reply. I only can say that when I comment or remove the condition I posted the variables are working OK. My intention was to reset all variables with a new session. And I thought this will work with if Bars.SessionBreak== true.

      I will find another way to do.

      Thank you
      Tony

      Comment


        #4
        When I work with data that I want to be reset at the beginning of a session, I use something like:
        Code:
        if(Bars.FirstBarOfSession)
        {
          //Reset things here
        
        }
        On occassion I also use the other side when I want to collect values at the end of the session by inserting this near the end of my onBarUpdate loop:
        Code:
        if(Bars.LastBarOfSession)
        {
          //Do something with my collected values
        }
        I am unsure if the Bars.LastBarOfSession is recommended to use? But I have used it for years w/o any problems that I am aware of.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        77 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        45 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        27 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X