Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MTF indicator questions

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

    MTF indicator questions

    I'm writing a signal indicator in which I want to use the value of another indicator (Stoch cycle). I need the value of StochCycle2 for the following : 6 Range, 12Range, 24Range. The indicator will plot these StochCycles on the 6 Range chart in panel 2 for all three and color bars on the price panel based on a formula from my new indicator.

    I've created custom indicators before, but nothing this complex... I have limited knowledge of NinjaScript and C#.

    2 questions:
    1. How do I reference the 2 alternate time frames (12R & 24R)? Do I need to have the charts displayed in these time frames in my workspace?
    2. How do I reference StochCycle2 from its own indicator (I don't want to replicate that code in this new bar coloring indicator).

    I've attached the indicator that I'm trying to reference.

    Appreciate any help.
    Saroj
    Attached Files

    #2
    Saroj,
    Not aware of the perticular indicator, but I am giving you the basic idea by demonstrating via a SMA. you could easily figure out the rest.

    suppose you are watching a 5 minutes charts (thats the primary bar series, BarsArray[0]) and you want to add 2 addition series say 6 range and 12 range then

    in Initialize add the following lines of code
    Code:
    [COLOR=Green]Add(PeriodType.Range,6);[/COLOR]
    [COLOR=Blue]Add(PeriodType.Range,12);[/COLOR]
    you call the indicator (i am using SMA) as

    Code:
    SMA([COLOR=Green]Closes[1][/COLOR],14); //calculate the sma14 for the 6 range dataseries 
    SMA([COLOR=Blue]Closes[2][/COLOR],14); // calculate the sma14 for the 12 range dataseries
    you can
    Last edited by bukkan; 08-14-2011, 02:35 AM.

    Comment


      #3
      Hi saroj,

      Thanks, bukkan.

      To get an idea of the syntax for referencing custom indicators, the strategy wizard condition builder is good for this. You can create a basic expression there and click view code, then copy paste this into another script.

      General multiseries tips available here.
      Ryan M.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X