Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimize Data Series Value

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

    Optimize Data Series Value

    I have the same question:




    How to strategy test against multi timeframes ?
    How do I take a strategy and after beacktesting it, them run the optimizer using many different time frames? Restated, I run a successful backtest, get a good result lets say using 10 minute charts, I can manually set backtest to 15(or 4 or whatever) and run it again, how can I set a range of minutes ( 1 to 30) or whatever, and get the optimizer to find out the most profitale period for my strategy. PS I know how to set a "slow" / "fast" MS variable and have optimizer run against all combinations, can't seem to figure how to do same with minutes.
    Thanks
    Wilson


    Wilson,

    Optimizing on the data series is currently not available in NT6.5.
    We create the data series as a parameter, and we can backtest it ok, but if we want to optimize this parameter, the result is the same for all minute bars...

    We are trying to optimize a strategy with respect to the parameter "tbarrainterna1" (size in minutes of the internal work bar array) and parameter "Simple". Running the strategy with "backtest" gets logical results for each parameter combination. But executing "Optimize" the results for the tests are identical for every "tbarrainterna1" value while "Simple" is constant.


    SAMPLE CODE.

    protected override void Initialize()
    {
    Add(PeriodType.Minute,tbarraInterna1 ); //indice de acceso 1
    Add(SMA(Simple));

    CalculateOnBarClose = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    switch (BarsInProgress)
    {
    case 0: //BARRAS POR DEFECTO DEL GRAFICO EN USO
    //NADA break;
    case 1: //BARRAS tbarrainterna1
    // Condition set 1
    if (Closes[1][0] > SMA(BarsArray[1],Simple)[0])
    {
    EnterLong(DefaultQuantity, "");
    }

    // Condition set 2
    if (Closes[1][0] < SMA(BarsArray[1],Simple)[0])
    {
    EnterShort(DefaultQuantity, "");
    }

    break;
    ......
    #region Properties
    //-------------------------------------------------
    [Description("")]
    [Category("Parameters")]
    public int Simple
    {
    get { return simple; }
    set { simple = Math.Max(1, value); }
    }




    /////////////////////////////////////////////////////////////////////
    [Description("Tiempo de la barra para el calculo interno.")]
    [Category("Parameters")]
    public int TbarraInterna1
    {
    get { return tbarraInterna1; }
    set { tbarraInterna1 = Math.Max(1, value); }
    }


    Best Regards,
    Federico Benitez.

    #2
    Welcome to the NinjaTrader support forums!

    Unfortunately this is not supported, as the PeriodType in the Initialize() / Add can't be changed dynamically.

    This is however on our list for future consideration.

    Comment


      #3
      Will this now be possible with NT7?

      Mike

      Comment


        #4
        There will be more flexibility in optimizing in NT7.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        68 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        41 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        24 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        27 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        54 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X