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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      57 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      9 views
      0 likes
      Last Post cre8able  
      Working...
      X