Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Refrencing Bar Pattern

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

    Refrencing Bar Pattern

    How would I create a pattern that can be referrenced. For example I define a Doji bar and then be able to reference it has Doji[1] = true for one bar back or Doji[5] =1 for 5 bars back.

    I have

    #region Variables
    private DataSeries myEMA, upperBand, lowerBand, doji;


    protected override void Initialize()
    doji = new DataSeries(this);

    protected override void OnBarUpdate()
    Doji.Set=
    Open[0] == Close[0]
    && High[0] > Open[0]
    && Low[0] < Open[0];

    I keep getting an error, "Can't assign to Set because it is a Method Group"

    How would I do this so that if it is true, i get a value of 1 i.e. true ?

    #2
    Originally posted by velocity View Post
    How would I create a pattern that can be referrenced. For example I define a Doji bar and then be able to reference it has Doji[1] = true for one bar back or Doji[5] =1 for 5 bars back.

    I have

    #region Variables
    private DataSeries myEMA, upperBand, lowerBand, doji;


    protected override void Initialize()
    doji = new DataSeries(this);

    protected override void OnBarUpdate()
    Doji.Set=
    Open[0] == Close[0]
    && High[0] > Open[0]
    && Low[0] < Open[0];

    I keep getting an error, "Can't assign to Set because it is a Method Group"

    How would I do this so that if it is true, i get a value of 1 i.e. true ?
    1. DataSeries must contain double values.
    2. you might want to use boolseries.

    #region Variables
    private BoolSeries doji;


    protected override void Initialize()
    doji = new BoolSeries(this);

    protected override void OnBarUpdate()
    doji.Set(Open[0] == Close[0] && High[0] > Open[0] && Low[0] < Open[0]);

    Comment


      #3
      Thanks for your help roonius!

      Here's a link to the BoolSeries Class - http://www.ninjatrader-support.com/H...riesClass.html

      Comment


        #4
        roonius,

        Thanks for all the help. I will give it a try. and thanks for the post Bertrand.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        574 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X