Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 AttiM, 02-14-2024, 05:20 PM
      12 responses
      213 views
      0 likes
      Last Post DrakeiJosh  
      Started by cre8able, 02-11-2023, 05:43 PM
      3 responses
      238 views
      0 likes
      Last Post rhubear
      by rhubear
       
      Started by frslvr, 04-11-2024, 07:26 AM
      8 responses
      117 views
      1 like
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      10 responses
      47 views
      0 likes
      Last Post stafe
      by stafe
       
      Started by rocketman7, Today, 09:41 AM
      3 responses
      12 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X