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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X