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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    169 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    324 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    250 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    351 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    180 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X