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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    421 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    279 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    238 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    324 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    288 views
    0 likes
    Last Post CarlTrading  
    Working...
    X