Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enable Checkbox Won't Stay Checked

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

    Enable Checkbox Won't Stay Checked

    Hi. I have a strategy where I reference 5 bars ago, 6, 7, 8 and 9. It works fine here. Once I add the exact same line but instead reference 10 bars ago it then won't allow the enable checkbox to stay checked after I apply it to a chart.

    Here is the code that works as expected.

    Code:
    if (
    
                    (
    
                    (Low[0] == (Low[5] + (EntryOffset_Long * TickSize)))
                    || (Low[0] == (Low[6] + (EntryOffset_Long * TickSize)))
                    || (Low[0] == (Low[7] + (EntryOffset_Long * TickSize)))
                    || (Low[0] == (Low[8] + (EntryOffset_Long * TickSize)))
                    || (Low[0] == (Low[9] + (EntryOffset_Long * TickSize)))
    
                    )
                    && (BarWick == true)
    
                    )
    
    {
                    EnterLong(Convert.ToInt32(DefaultQuantity), "");
                }​
    
    ​
    Once I change it so that it includes the Low[10] like this:

    Code:
    if (
    
                    (
    
                    (Low[0] == (Low[5] + (EntryOffset_Long * TickSize)) )
                    || (Low[0] == (Low[6] + (EntryOffset_Long * TickSize)))
                    || (Low[0] == (Low[7] + (EntryOffset_Long * TickSize)) )
                    || (Low[0] == (Low[8] + (EntryOffset_Long * TickSize)) )
                    || (Low[0] == (Low[9] + (EntryOffset_Long * TickSize)) )
                    || (Low[0] == (Low[10] + (EntryOffset_Long * TickSize)) )
    
                    )
                    && (BarWick == true)
    
                    )
    
    
    
                {
                    EnterLong(Convert.ToInt32(DefaultQuantity), "");
                }​
    it then doesn't let the checkbox stay checked.

    Any help appreciated!

    #2
    Hello yeahdudeman,

    You are likely having an error, please check the control center log tab after trying to enable it.

    If you get an error when changing the BarsAgo you also need to update your CurrentBar check:

    if(CurrentBar < 10) return;

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 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
    69 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