• 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 MNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wishing, 07-19-2019, 03:33 PM
    1 response
    25 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by Venom, Yesterday, 01:05 PM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by thgamey, Today, 02:05 AM
    2 responses
    14 views
    0 likes
    Last Post thgamey
    by thgamey
     
    Started by yeshujbp, Yesterday, 02:40 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by sardana, Today, 05:52 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Working...
    X