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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X