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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X