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 bill2023, Yesterday, 08:51 AM
    8 responses
    43 views
    0 likes
    Last Post bill2023  
    Started by yertle, Today, 08:38 AM
    6 responses
    25 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    46 views
    0 likes
    Last Post jeronymite  
    Working...
    X