Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiTimeFrame Comparison

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

    MultiTimeFrame Comparison

    Hi :

    I will appreciate if someone could help in this regard

    Using the Stochastic Indicator in the Ninja Trader , How could I compare % K value of a 200 Tick chart with that of 600 tick chart.
    When I say compare i would like to compare whether both are rising or falling at a given time . Say for example from bar[1] to bar [0]
    I want to do this in a multi Time Frame Strategy.


    Thank You



    #2
    Hello Simple,

    You may use the Add() method to add another Time Frame Series in your script to have the Multi Time Frame comparison that you are looking for.

    Once added in you may then use the BarsArray object to get the Stochastics value that you are looking for.

    For example:
    protected override void Initialize()
    {
    Add(PeriodType.Tick, 600);
    }


    Then in OnBarUpdate() you may use the BarsArray[1] to reference the 600 Tick Series.

    protected override void OnBarUpdate()
    {
    // Ignore bar update events for the supplementary Bars object added above
    if (BarsInProgress == 1)
    return;
    if (Rising(Stochastics(BarsArray[1], 3, 14, 7).K) && Rising(Stochastics( 3, 14, 7).K) )
    // Do something

    }

    Here is a good Help Guide article that will go over this in more detail that you may view.


    The Rising() method will check to see if the current value is greater than the previous value automatically for you.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    68 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    61 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X