Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Timeframes with different Performance Summarys

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

    Multiple Timeframes with different Performance Summarys

    Hello,

    i have a problem with the Multiple Timeframes.
    What do i have:
    sad

    multiple Timeframes like
    Add(PeriodType.Minute,5);
    Add(PeriodType.Minute,15);
    Add(PeriodType.Minute,30);
    Add(PeriodType.Minute,60);

    on ANY, seriously ANY point i added a variable [Timeframe] like
    && HighestBar(Highs[Timeframe],20) <=3
    witch is set at the beginning to an fixed value like 1 at the moment.

    So i should work all the time in the main timeframe of 5min, right?

    But if i open the Chart in a 5minute Chart ninja is called so smart to detect that i am working twice with an 5min timeframe and is doing something.
    Is it deleting my [1] so that the 15min Timeframe is the new [1] ?

    Anyway, i tried to skip that problem by switch
    Add(PeriodType.Minute,5);
    to
    Add(PeriodTypeSecond,300);
    which should be the same in my opinion.


    But now to the Main Problem.
    If i Open the 5, 15or 60min Chart with the setting for 5min, i get a totally different Performance Summary. Does anybody know how i can fix that problem or if i have to write separate strategies for each time window an own one?!

    Thanks for help i hope u get my Problem

    #2
    Probably is there a mistake in the syntax so i copied the used parts:

    SMA(BarsArray[Timeframe+1], 3)[0]
    HighestBar(Highs[Timeframe], X) <= Y)
    Highs[Timeframe][HighestBar(Highs[Timeframe];
    -->
    ADX(BarsArray[Timeframe+1],X)[Y])
    Lows[Timeframe+1][1]
    EMA(Opens[Timeframe+1],20)[1];

    http://www.ninjatrader.com/support/f...ad.php?t=51632
    and this wasn't really helping till

    Comment


      #3
      Hi eNhale,

      Thank you for your note.

      The time frames should not be changing their BarsInProgress index, even if the primary matches one of the secondary series.

      I have created a test script that prints to the Output window to demonstrate this.

      However, the fill type algorithm is run after every OnBarUpdate call when the same instrument is used no matter what BarsInProgress is running, even if the exit order uses a specific BarsInProgress index. If the instrument is separate, it will not run the fill type algorithm for any BarsInProgress that does not share the same instrument.

      The order will fill on the first BarsInProgress that has the price needed for the order to fill. Likely this will be the BarsInProgress 0. However, if the primary bars in progress is not run due to the interval and the secondary is run and the secondary has the price needed to fill, the order will fill on the second bars in progress. Then the third and so on. Depending on which BarsInProgress fills the order will cause the the time of the fill to be different.

      The only way around this would be to write your own fill algorithm.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        THX for your fast help again!

        I am not 100% sure, but i guess i fixed it with:

        if (BarsPeriods[BarsInProgress].Value != BarsPeriods[Timeframe].Value )
        BarsPeriods[BarsInProgress].Value = BarsPeriods[Timeframe].Value;

        if (BarsPeriods[BarsInProgress].Id != BarsPeriods[Timeframe].Id )
        BarsPeriods[BarsInProgress].Id = BarsPeriods[Timeframe].Id;

        The Timeframe was checking out each case and did a lot of stuff.... even when the TF wasn't in use for the hole strategy setup....

        anyway i will check it out tomorrow but the first tests are looking fine!

        Thanks again and have a lovely day!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Taddypole, 04-26-2024, 02:47 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by futtrader, 04-21-2024, 01:50 AM
        6 responses
        58 views
        0 likes
        Last Post futtrader  
        Started by sgordet, Today, 11:48 AM
        0 responses
        4 views
        0 likes
        Last Post sgordet
        by sgordet
         
        Started by Trader146, Today, 11:41 AM
        0 responses
        5 views
        0 likes
        Last Post Trader146  
        Started by jpapa, 04-23-2024, 07:22 AM
        2 responses
        19 views
        0 likes
        Last Post rene69851  
        Working...
        X