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:
    Add(PeriodType.Range,6);
    Add(PeriodType.Range,12);
    you call the indicator (i am using SMA) as

    Code:
    SMA(Closes[1],14); //calculate the sma14 for the 6 range dataseries 
    SMA(Closes[2],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 tonynt, Today, 11:50 AM
      0 responses
      2 views
      0 likes
      Last Post tonynt
      by tonynt
       
      Started by Welovethelibrary, Today, 11:44 AM
      0 responses
      2 views
      0 likes
      Last Post Welovethelibrary  
      Started by goodknight777, Today, 11:39 AM
      0 responses
      3 views
      0 likes
      Last Post goodknight777  
      Started by MohammedAmine, Today, 10:44 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by Nolyn, Today, 10:59 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X