Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategic timeframe minimum value

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

    Strategic timeframe minimum value

    Hi,

    I have added second time frame to my strategy - so called Strategic Time Frame. It can be minute TF or day TF. Please find below some code to illustrate this.

    Code:
    private bool 	tF_D = true;
    private int 	tF_strategic = 5;
    
    ...
    
    // TF dla decyzji strategicznej - BarsArray[1]
    if (tF_D) {Add(PeriodType.Day, tF_strategic);}
    if (!tF_D) {Add(PeriodType.Minute, tF_strategic);}	
    
    ...
    
    [Description("Okres dla TF strategiczny")]
    [GridCategory("Parametry - Ogolne")]
    [Gui.Design.DisplayName ("\t\t\tTF strategiczny")]
    public int TF_strategic
            {
                get { return tF_strategic; }
                set { tF_strategic = Math.Max(1, value); }
            }
    As you can see I have minimum value for tF_strategic set to "1". I would like to change it to have minimum value as a time frame which I choose in Backtest window in Data series.

    Examle: if I choose 240 minutes in Data series I shall be unable to set strategic timeframe to less than 240 minutes.

    I assume that I have to change 1 to something else that represent chosen data series.

    Please support.

    #2
    Hi kucharek,

    Unfortunately you cannot use BarsPeriod as a minimum value. It's just not available where you would need to specify it. The earliest you could access bar properties is OnBarUpdate().
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    61 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X