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 rebeccamia11, Today, 02:10 AM
    0 responses
    2 views
    0 likes
    Last Post rebeccamia11  
    Started by rebeccamia11, Today, 02:05 AM
    0 responses
    1 view
    0 likes
    Last Post rebeccamia11  
    Started by rebeccamia11, Today, 01:57 AM
    0 responses
    3 views
    0 likes
    Last Post rebeccamia11  
    Started by rebeccamia11, Today, 01:40 AM
    0 responses
    2 views
    0 likes
    Last Post rebeccamia11  
    Started by Moraha, 10-17-2023, 09:03 PM
    4 responses
    207 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Working...
    X