Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Timeframe GUI select

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

    Multi Timeframe GUI select

    I seem to be having trouble getting a GUI selection to work for a multi timeframe instrument...

    I'm essentially wanting my Strategy to allow the change of the number of bars that it's referencing.

    So I have a variable:

    Code:
    int numbars = 7; // for 7 bars of data, that can be changed via the GUI
    PeriodType type = PeriodType.Day; // set the period type to Day
    in Initialize I have:

    Code:
    Add(type,numbars);

    In the properties section I have something like:


    Code:
           
    [Description("")]
    [Category("Parameters")]
    public PeriodType Type
    {
        get { return type; }
        set { type = value; }
    }
    		
    [Description("")]
    [Category("Parameters")]
    public int NumBars
    {
        get { return numbars; }
        set { numbars = value; }
    }
    The strategy runs, but doesn't appear to actually use the changed values for type and numbars.

    Is this something that can be done?

    Thanks

    Matt

    #2
    Hi Matt, unfortunately you can't Add bars objects dynamically - you could add all the daily series you need and then calculate according to BIP context as needed.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    603 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    349 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    104 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    560 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    560 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X