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

Indicator based on another indicator

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

    Indicator based on another indicator

    I'm trying to create and indicator based on the calculated variables from another indicator(PriorDayOHLC).

    After searching and reading what's available online (http://www.ninjatrader.com/support/f...ead.php?t=4991) and downloading the "SampleBoolSeries.zip", I'm still confused about the steps required.

    How do I call the OHLC from the "PriorDayOHLC" indicator (variables are below)? Do I create BoolSeries and used them in the calculations? What is needed for the #region Properties?

    Thanks for the help.

    #region Variables

    // Wizard generated variables
    // User defined variables (add any user defined variables below)
    private DateTime currentDate = Cbi.Globals.MinDate;
    privatedouble currentOpen = 0;
    privatedouble currentHigh = 0;
    privatedouble currentLow = 0;
    privatedouble currentClose = 0;
    privatedouble priordayOpen = 0;
    privatedouble priordayHigh = 0;
    privatedouble priordayLow = 0;
    privatedouble priordayClose = 0;
    privatebool showOpen = true;
    privatebool showHigh = true;
    privatebool showLow = true;
    privatebool showClose = true;
    #endregion

    void Initialize()
    {
    Add(new Plot(Color.Orange, PlotStyle.Hash, "Prior Open"));
    Add(new Plot(Color.Green, PlotStyle.Hash, "Prior High"));
    Add(new Plot(Color.Red, PlotStyle.Hash, "Prior Low"));
    Add(new Plot(Color.Firebrick, PlotStyle.Hash, "Prior Close"));

    #2
    Hello 2Look4me,

    You would not be able to get the variables as they are private the class object only.

    You would want to access the PriorOpen, High, Low, and Close dataseries which can be done with the following -

    PriorDayOHLC().PriorOpen[0];
    PriorDayOHLC().PriorHigh[0];
    PriorDayOHLC().PriorLow[0];
    PriorDayOHLC().PriorClose[0];

    http://www.ninjatrader.com/support/h...r_day_ohlc.htm
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Cal, that helped.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DJ888, Today, 10:57 PM
      0 responses
      6 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      158 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Today, 09:29 PM
      0 responses
      7 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Working...
      X