• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 samir, Yesterday, 09:27 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by elnoppo, Today, 12:32 AM
    0 responses
    4 views
    0 likes
    Last Post elnoppo
    by elnoppo
     
    Started by karolwatcher, Yesterday, 08:15 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by lwyatt100, Yesterday, 10:13 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by patpat, Yesterday, 10:45 PM
    0 responses
    3 views
    0 likes
    Last Post patpat
    by patpat
     
    Working...
    X