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

Multi Range Strategy Question

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

    Multi Range Strategy Question

    NT,

    I want to see 4 lines plotted on my 2 Tick Range Chart.
    Here is the code so far.
    -----------------------------------------------------------------------

    protectedoverridevoid Initialize()

    {

    Add("", PeriodType.Range , 4);
    Add("", PeriodType.Range , 6);
    Add("", PeriodType.Range , 8);


    Add(TRIXoverlayGreen(3, 4.5, 3.75));
    Add(TRIXoverlayGreen(BarsArray[1],3, 4.5, 3.75));
    Add(TRIXoverlayGreen(BarsArray[2],3, 4.5, 3.75));
    Add(TRIXoverlayGreen(BarsArray[3],3, 4.5, 3.75));

    CalculateOnBarClose = true;

    }

    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>

    protectedoverridevoid OnBarUpdate()

    {

    if (BarsInProgress == 0)

    {
    // Do Something
    }

    if (BarsInProgress == 1)

    {
    // Do Something
    }

    if (BarsInProgress == 2)

    {
    // Do Something
    }

    if (BarsInProgress == 3)

    {
    // Do Something
    }

    --------------------------------------------------------------
    Is it possible to plot these 4 lines on the same chart through this strategy?

    What needs to be added to each "bar in progress" make this happen?

    Thanks,

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    #2
    Add("", PeriodType.Range , 4);
    Add("", PeriodType.Range , 6);
    Add("", PeriodType.Range , 8);

    You need to type in a symbol name to add those symbols. If you just want whatever is selected by the chart, remove that parameter.

    You cannot plot other series' data onto the primary time frame.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I was looking for a solution to my problem, which is I cannot get my indicator to compile with the following line of code in the initialize section:

      Add(PeriodType.Range, 9);

      I get a "No overload for method 'Add' takes '2' arguments" error message. Noticed there was another thread regarding this specific problem, but the solution was unclear to me - something about removing spaces??

      Regardless, what I want to do is plot a channel on my chart (same symbol, different bar type and timeframe) using range bar data. However, I see from Josh's reply to a previous post that "You cannot plot other series' data..." onto a chart, if I understand correctly. Is this still the case and will it change in NT7?

      Thanks!


      Originally posted by NinjaTrader_Josh View Post
      Add("", PeriodType.Range , 4);
      Add("", PeriodType.Range , 6);
      Add("", PeriodType.Range , 8);

      You need to type in a symbol name to add those symbols. If you just want whatever is selected by the chart, remove that parameter.

      You cannot plot other series' data onto the primary time frame.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sastrades, 05-10-2024, 09:59 AM
      3 responses
      53 views
      0 likes
      Last Post rc5781
      by rc5781
       
      Started by guyonabuffalo, Yesterday, 10:01 PM
      2 responses
      18 views
      0 likes
      Last Post guyonabuffalo  
      Started by thumper57, Yesterday, 04:30 PM
      5 responses
      15 views
      0 likes
      Last Post thumper57  
      Started by reynoldsn, 05-10-2024, 07:04 PM
      5 responses
      26 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by llanqui, Today, 11:10 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X