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 kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    34 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    29 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    36 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    33 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    144 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X