Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MTF Filter Possible?

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

    MTF Filter Possible?

    Is there a way to set a condition for the MA filter on multiple time frames? For example I have 2 time frame columns for the same indicator, I would like it if the condition is met on one of them or both of them for it to show in MA but if the condition is false on both time frames for the instrument to be filtered out of MA...

    I assume this would have to be hard coded but just curious if it is possible any any tips on how to do it...

    Thanks,
    R.T.

    #2
    Hi RT,

    It is unfortunately not possible to combine or communication multiple market analyzer columns for use in a filter.

    For you to do this, you would need to code all the logic into a single multi-series script applied to one column.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan,

      when I add:

      Add(PeriodType.Minute,10);

      and create the MTF indicator condition the indicator suddenly plots incorrect and iratic... any ideas of what would cause this?

      Thanks

      Comment


        #4
        That's only one part of a complete multiseries script. You also need to use it somewhere, like set a plot based on it or access its values. You can use BarsInProgress to filter updates to a specific series and could also access its values with Closes[1][0], Highs[1][0], etc.

        Without taking a look at your OnBarUpdate() section, I would guess that you aren't using BarsInProgress at all and are then setting a single plot with each update(for all series in the script).

        Please have a look here for documentation on multiseries scripts:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hi Ryan,

          I actually got the indicator plotting correctly now, I am confused though on the logic or how to create a condition for the market analyzer between 2 time frames... I created 2 plots (one for each timeframe) but that also will not work in MA... Thanks for any advice

          Comment


            #6
            Great to hear the indicator is plotting.

            A basic example would be something like this, which checks that close price is greater than SMA on two time frames. For market analyzer filters, a common approach is setting a plot value to 1 when your condition is true and 0 otherwise.

            Code:
            if(Close[0] > SMA(Close, 14)[0] && Close[0] > SMA(Closes[1], 14)[0])
            {
            	Value.Set(1);
            }
            
            else
            {
            	Value.Set(0);
            }
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hi Ryan,

              Yes, thanks... I am familiar with that coding... the problem is I do not want it to be if both conditions are equal on the 2 time frames... I need it so they can be independent from each other as well... Does your code above do that? Meaning if the condition is true on one time frame but not on the other time frame it will still plot the "Value.Set(1)?

              Thanks, hope that makes sense...

              Comment


                #8
                The two conditions are joined by &&. Both parts must be true for the whole expression to evaluate as true.

                If you wanted to set as 1 when either part is true, you can use OR operator ||
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  ahhh... Think I got it... Thanks for the help again!

                  Comment


                    #10
                    filter on a 1 m chart

                    when u set a filter say on cci less than -100 on a cci one minute chart,so u have to have a one minute chart open on each of teh finanical instruments in your market anaylzer list for it to filter that list in market analyzer?

                    Comment


                      #11
                      laredo78676, this thread was about creating MTF filter in the MA through custom coding / programming as this would not be possible per default. If you don't want to code this out but have an overview over different timeframe statuses then please add an indicator for every time frame series you wish to monitor in your MA.
                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Max238, Today, 01:28 AM
                      2 responses
                      26 views
                      0 likes
                      Last Post NinjaTrader_ChristopherJ  
                      Started by Shansen, 08-30-2019, 10:18 PM
                      25 responses
                      949 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by JonesJoker, 04-22-2024, 12:23 PM
                      8 responses
                      41 views
                      0 likes
                      Last Post JonesJoker  
                      Started by timko, Today, 06:45 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post timko
                      by timko
                       
                      Started by Waxavi, 04-19-2024, 02:10 AM
                      2 responses
                      39 views
                      0 likes
                      Last Post poeds
                      by poeds
                       
                      Working...
                      X